Home > database >  Flutter command not found on mac?
Flutter command not found on mac?

Time:09-04

after installing flutter on mac, when trying flutter doctor works correctly, but when go to the project and type flutter build apk get <zsh: command not found: flutter>

CodePudding user response:

Perhaps go to your .zshrc file and add your path to flutter/bin?

My .zshrc file is located here:

Users/[my_user_name]/.zshrc

Usually, you won't be able to see this file using Finder because it's hidden. In your home directory from Finder hit Cmd Shift . to see hidden files. Then you will be able to access them. If that file doesn't exist, create one.

Once you're in that file, add the path to your flutter/bin. In my case, that path looked like this:

export PATH="$PATH:/Users/[my_user_name]/Development/flutter/bin/"

Hope this helps!

CodePudding user response:

In the flutter documentation:

Add the flutter tool to your path:

 export PATH="$PATH:`pwd`/flutter/bin"

This command sets your PATH variable for the current terminal window only. To permanently add Flutter to your path, see Update your path.

The solution is what Karolina said, you edit the .zshrc file to be able to use the flutter command for all terminal sessions.

  • Related