Flutter command not found / flutter doctor

660

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.

Share:
660
Admin
Author by

Admin

Updated on December 15, 2022

Comments

  • Admin
    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
      Juan V over 4 years
      I'm sorry to ask since I only use Windows currently, which OS are you on? Either way, you can find how to upate the PATH permanently here for linux: link and here for macOS link
    • Admin
      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
      Juan V over 4 years
      Thanks, could you post the contents of your $HOME/.bashrc (or $HOME/.zshrc for Catalina) on your question?
    • Admin
      Admin over 4 years
      this is my out put for trying to set $HOME. Though, it resets everytime I exit terminal
    • Admin
      Admin over 4 years
      temur@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/fl‌​utter temur@Temurs-MacBook-Pro ~ % flutter doctor
    • Juan V
      Juan V over 4 years
      Yes, 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/f‌​lutter/bin") then save the file, then the next time you open a new terminal it should be available.
    • Admin
      Admin over 4 years
      hmm its still the same case
    • Juan V
      Juan V over 4 years
      To get help, I recommend you edit your original question and post the contents of your bashrc file to see exactly what you added.
    • Admin
      Admin over 4 years
      in my bash profile file: export PATH="$PATH:/Users/temur/Documents/Projects/Flutter/tools/fl‌​utter/bin"