I'm installing flutter, have followed all the steps in the documentation and also a online course and have set the Path in my .bash_profile file, however every time I try to run a Flutter command I get the error:
-bash: flutter: command not found
Above screen shot of my .bash_profile file.
Here's what I am trying to run:
Carsons-MBP:~ carsoncarbery$ flutter doctor
-bash: flutter: command not found
Carsons-MBP:~ carsoncarbery$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:Users/carsoncarbery/development/tools/flutter/bin
My flutter folder is in this directory:
Users/carsoncarbery/development/tools/
Go to My Computer Properties > Advance System Setting > Environment Variables. In this way, you can solve 'flutter' is not recognized as an internal or external command error in Windows OS.
After the Flutter plugin has been installed, you should find the File > New > New Flutter Project menu. If your Android Studio currently doesn't open any project, there should be Create New Flutter Project option on the welcome popup. Click on it and it will open a new popup.
On Mac OS, insert single quotes OR double quotes around the file path like below. It's better to work like this with file paths in source files:
export PATH="/Users/carsoncarbery/development/tools/flutter/bin":$PATH
or
export PATH='/Users/carsoncarbery/development/tools/flutter/bin':$PATH
export PATH=/Users/carsoncarbery/development/tools/flutter/bin:$PATH
After scrambling a lot over many answers . finally I found out that we need to know which shell we are using.
So as per flutter docs,
If you’re using Bash, edit $HOME/.bash_profile or $HOME/.bashrc. If you’re using Z shell, edit $HOME/.zshrc.
As I was using Bash all I did was
touch .bash_profile
open .bash_profile
add my path in .bash_profile as
export PATH="$PATH:/Users/krtrsda/flutter/bin"
run flutter command & we are good to go..
If you are using Z shell
touch ~/.zshrc
open ~/.zshrc
and then add path same as we did for .bash_profile.
Thanks to pskink who solved this one for me. It should've been:
/users/
instead of:
users/
Removing quotes fixed the problem for me. Running MacOS Catalina 10.15.5
Before:
export PATH="$PATH:/Users/me/Developer/flutter/bin"
After:
export PATH=$PATH:/Users/me/Developer/flutter/bin
On macOS Catalina, open terminal, follow this step:
Here is the complete solution. First of all create zshrc file, if not create already. and to see this use cmd + shift + .
now you need to set environment path using
open terminal and hit command
vim $HOME/.zshrc
press "I" or "i"
key for enabling inster mode.
add the path of your flutter sdk folder
same like the following line
export PATH="$PATH:/Users/mobileprogramming/Development/sdks/flutter/bin"
"Esc"
then write :wq!
in terminal and press enter to exit editing.flutter doctor
or just flutter
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With