Flutter commands do not work in terminal on Mac OS after update
Solution 1
So I worked this out by manually downloading the flutter SDK then replace it into the original flutter folder. I think it's a problem with the flutter upgrade not being able to completely revert the changes it made after failing to upgrade from the command line.
Solution 2
The way I aliased the flutter command on Mac was by editing my ~/.bash_profile
file:
vi ~/.bash_profile
Then add the lines:
alias flutter="/Users/n/development/flutter/bin/flutter"
After you save the file (e.g: by typing [esc] :wq
in Vim)
run the "source" command to load the aliases into your current terminal session:
source ~/.bash_profile
Now the flutter command works in terminal e.g: flutter doctor
, flutter test
and flutter run
Ref: https://github.com/dwyl/learn-flutter/issues/27#issuecomment-583831888
Comments
-
Aamir over 1 year
I am running on a Mac, I downloaded Flutter through Git and can confirm that the files are all there, I also successfully updated my path in my ~/.zshrc file. This was all working fine until I ran
flutter upgrade
, after which theflutter
command stopped working. I confirmed this by runningwhich flutter
and the output was:/Users/aamir/development/flutter/bin/flutter
which looks correct. However, running
flutter
in my terminal gives me back this error:: command not foundpment/flutter/bin/internal/shared.sh: line 5:
Not sure what's the issue here
-
Aamir about 3 yearsYup this solves it, need to re-install the SDK manually rather than using git to re-install