Flutter commands do not work in terminal on Mac OS after update

Viewed 2614

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 the flutter command stopped working. I confirmed this by running which 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

2 Answers

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.

For zsh:

For zsh (Apple M1):

   1.Open Terminal
   2.Run: nano ~/.zshrc
   3.Add: export PATH=[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin:$PATH
   4.Run: source ~/.zshrc
   5.restart terminal
   6.Run: flutter doctor -v
Related