stacked
stacked copied to clipboard
[docs]: Setup stacked-cli on windows with correct path settings
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
- Run
dart pub global activate stacked_cli
as usual. If callingstacked
results in "bash: stacked: command not found" then you'll need to add pub cache to your local path. - 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 newstacked.bat
file. - Open up
~/.bashrc
with for example notepad or another editor:notepad ~/.bashrc
- 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'
- 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
- Run
source ~/.bashrc
in order to let bash update the path configuration. - Now run
stacked --version
and you'll see the current version of the installed stacked package.
Windows + cmd/powershell
- Run
dart pub global activate stacked_cli
as usual. If callingstacked
results in a not found error then you'll need to add pub cache to your local path. - Open your environmental variables settings in Windows (something like this helps: https://thegeekpage.com/environment-variables-in-windows-11/)
- Edit the "Path" entry and click on "New". Add
%LOCALAPPDATA%\Pub\Cache\bin
- Close everything and re-open the cmd/powershell.
- Now run
stacked --version
and you'll see the current version of the installed stacked package.
Hope this helps.