zsh: command not found: flutter

83,586

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.

  1. Open terminal.

  2. vim $HOME/.zshrc

  3. Press "I" key for going to insert mode.

  4. add the following line in the opened file:

    export PATH="$PATH:/YOUR_FLUTTER_DIR/flutter/bin"

  5. Press "Esc" then write :wq! in terminal and press enter to exit vim.

  6. 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

  1. Provide Full Disk Access to Terminal by Setting -> Security & Privacy -> Full Disk Access. Add Terminal

  2. If the current terminal uses bash, change to zshell using the below command

    chsh -s /bin/zsh

  3. In the root directory i.e something like /Users/^YourAccount^ execute the below

    touch .zprofile

    vim .zprofile

  4. Press I to enter insert mode. Type the below

    export PATH=$PATH:/Users/^YourAccount^/^YourPath^/flutter/bin

  5. Save and quit by pressing Esc, then :wq and Enter

  6. 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

Share:
83,586
Code Hunter
Author by

Code Hunter

Updated on July 23, 2022

Comments

  • Code Hunter
    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.