stacked icon indicating copy to clipboard operation
stacked copied to clipboard

[docs]: Setup stacked-cli on windows with correct path settings

Open sebastianbuechler opened this issue 1 year ago • 2 comments

Describe the missing piece of documentation

When setting up stacked-cli on Windows there are some extra steps for the path required.

Windows + git bash

  1. Run dart pub global activate stacked_cli as usual. If calling stacked results in "bash: stacked: command not found" then you'll need to add pub cache to your local path.
  2. Open your explorer and in the address field type "%LOCALAPPDATA%\Pub\Cache\bin". Get the resolved address, it should be something like C:\Users\{yourUsername}\AppData\Local\Pub\Cache\bin. In the folder you'll see the new stacked.bat file.
  3. Open up ~/.bashrc with for example notepad or another editor: notepad ~/.bashrc
  4. Since on Windows we have a ".bat" file we need to create an alias. For this add this in the .bashrc file: alias stacked='stacked.bat'
  5. In order to add the pub cache to the path add this in the .bashrc file: export PATH="$PATH:{your path}" and make sure to replace the correct path according to step 2. Also, make sure that you'll replace Windows-style path characters. Example path: /c/Users/{yourUsername}/AppData/Local/Pub/Cache/bin
  6. Run source ~/.bashrc in order to let bash update the path configuration.
  7. Now run stacked --version and you'll see the current version of the installed stacked package.

Windows + cmd/powershell

  1. Run dart pub global activate stacked_cli as usual. If calling stacked results in a not found error then you'll need to add pub cache to your local path.
  2. Open your environmental variables settings in Windows (something like this helps: https://thegeekpage.com/environment-variables-in-windows-11/)
  3. Edit the "Path" entry and click on "New". Add %LOCALAPPDATA%\Pub\Cache\bin
  4. Close everything and re-open the cmd/powershell.
  5. Now run stacked --version and you'll see the current version of the installed stacked package.

Hope this helps.

sebastianbuechler avatar Jun 24 '23 10:06 sebastianbuechler