Hello Guys How are you all? Hope You all are fine. I have just installed flutter SDK and android studio in my macOS now I am running the flutter doctor command in my terminal and it give me the following error zsh: command not found: flutter. So today Here I come with all possible solutions for this error.
We are providing you all possible solutions to solve this error. let’s start this article without wasting your time.
How zsh: command not found: flutter Error Occurs ?
I have just installed flutter SDK and android studio in my macOS now I am running the flutter doctor command in my terminal and it give me the following error zsh: command not found: flutter.
zsh: command not found: flutter
How to Solve zsh: command not found: flutter Error?
- How to Solve zsh: command not found: flutter Error?
To solve zsh: command not found: flutter 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”
- zsh: command not found: flutter
To solve zsh: command not found: flutter 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”
Solution 1 for zsh
Problem is your terminal cant find flutter path so all we need to do is just add environment path. follow all below step to add 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”
Solution 2 for zsh
Simple and easy way to add your environment $PATH variable.
- Open the file
$HOME/.zshrc
$HOME
is your home path - add the following line in the opened file:
export PATH="$PATH:/YOUR_FLUTTER_DIR/flutter/bin"
- save the changes and restart your terminal session.
Solution 3 : For zprofile
- First of all, 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 commandchsh -s /bin/zsh
- In the root directory, i.e something like /Users/^YourAccount^ executes the below touch .zprofilevim .zprofile
- Now, Press I to enter insert mode. Type the below export PATH=$PATH:/Users/^YourAccount^/^YourPath^/flutter/bin
- then Save and quit by pressing Esc, then :wq and Enter
- After that Close Terminal and reopen Again. Then try executing flutter the command
Summery
So, It’s All About this Error. I hope this tutorial helps you to Solve your error. Please Comment Below if You stucks anywhere with my code. And please comment below which solution worked for you. Thank You.
Also Check Out Below Tutorials
- type List is not a subtype of type List
- Unable to locate android SDK flutter
- Flutter: Unhandled exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)
- CocoaPods could not find compatible versions for pod “Firebase/CoreOnly”
- ERROR: JAVA_HOME is not set and no ‘java’ command could be found in your flutter PATH. in flutter
Leave a Reply