Flutter command not found / flutter doctor
Figured it out; entered command: echo $PATH
spit out; /Users/temur/Projects/Flutter/tools/flutter/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands
which was different than the one that should be in my .bash_profile
/Users/temur/Documents/Projects/Flutter/tools/flutter/bin
Had to change this in my bash profile file.
Also, reverting my terminal to bash from zsh helped.
Admin
Updated on December 15, 2022Comments
-
Admin over 1 year
What I've tried: Adding/ editing the .bash_profile.rtf file to where the flutter SDK is contained.. export PATH=/Users/temur/Documents/Projects/Flutter/tools/flutter/bin:$PATH
after this, I try to run flutter doctor on terminal I get command not found.
even in the path.
Now, if I just copy+ paste the above command in terminal, it works. Though, it only works until the terminal is exited.
Any way for terminal to read the bash profile file?
-
Juan V over 4 years
-
Admin over 4 years@JuanV I have mac, and I've done that where it says you have to place that in the bash_prfile.rtf file
-
Juan V over 4 yearsThanks, could you post the contents of your $HOME/.bashrc (or $HOME/.zshrc for Catalina) on your question?
-
Admin over 4 yearsthis is my out put for trying to set $HOME. Though, it resets everytime I exit terminal
-
Admin over 4 yearstemur@Temurs-MacBook-Pro ~ % which flutter flutter not found temur@Temurs-MacBook-Pro ~ % source $HOME/.bash_profile temur@Temurs-MacBook-Pro ~ % which flutter /Users/temur/Documents/Projects/Flutter/tools/flutter/bin/flutter temur@Temurs-MacBook-Pro ~ % flutter doctor
-
Juan V over 4 yearsYes, it will be gone if you set it like that. You have to open the .bashrc file with a text editor and add (export PATH="$PATH:=/Users/temur/Documents/Projects/Flutter/tools/flutter/bin") then save the file, then the next time you open a new terminal it should be available.
-
Admin over 4 yearshmm its still the same case
-
Juan V over 4 yearsTo get help, I recommend you edit your original question and post the contents of your bashrc file to see exactly what you added.
-
Admin over 4 yearsin my bash profile file: export PATH="$PATH:/Users/temur/Documents/Projects/Flutter/tools/flutter/bin"
-