zsh: command not found: flutter
Solution 1
I followed URL to resolve my issue.
I simply created a .zshrc file which was not exist then added my PATH variables copied from existing .bashrc.
Solution 2
You need to update the environment path.
-
Open terminal.
-
vim $HOME/.zshrc
-
Press "I" key for going to insert mode.
-
add the following line in the opened file:
export PATH="$PATH:/YOUR_FLUTTER_DIR/flutter/bin"
-
Press "Esc" then write
:wq!
in terminal and press enter to exit vim. -
Reopen the terminal and check "flutter doctor"
If this solution not work, remove the double quote from path.
Solution 3
Working on macOS Catalina 10.15.5 (19F101). I have used .zprofile instead of .zhrc
-
Provide Full Disk Access to Terminal by Setting -> Security & Privacy -> Full Disk Access. Add Terminal
-
If the current terminal uses bash, change to zshell using the below command
chsh -s /bin/zsh
-
In the root directory i.e something like /Users/^YourAccount^ execute the below
touch .zprofile
vim .zprofile
-
Press I to enter insert mode. Type the below
export PATH=$PATH:/Users/^YourAccount^/^YourPath^/flutter/bin
-
Save and quit by pressing Esc, then :wq and Enter
-
Close Terminal and reopen Again. Then try executing
flutter
command
Solution 4
You must update your environment $PATH variable.
1) Open the file $HOME/.zshrc
$HOME
is your home path
2) add the following line in the opened file:
export PATH="$PATH:/YOUR_FLUTTER_DIR/flutter/bin"
3) save the changes and restart your terminal session.
The process is also documented here
Solution 5
For me removing double quotes did the fix.
Try changing
export PATH="$PATH:[PATH TO FLUTTER]/flutter/bin"
into
export PATH=$PATH:[PATH TO FLUTTER]/flutter/bin
adding few more steps for easiness:
Open terminal.
vim $HOME/.zshrc
Press "I" to open insert mode.
add the following line in the opened file:
export PATH=$PATH:[PATH TO FLUTTER]/flutter/bin (remember I don't have double quotes here)
Press "Esc" then type :wq in terminal to exit edit mode.
Type
source .zshrc
to reload the terminal for changes
Code Hunter
Updated on July 23, 2022Comments
-
Code Hunter almost 2 years
Recently I updated Mac OS to latest Catalina and my terminal which is using zsh now start showing me following error:
zsh: command not found: flutter
It was working fine before update.