I've been trying to set a flutter path so I don't need to do a temporary path every single time. I'm new to using terminal and Unix (Mac user also) and don't understand how to set my path with the instructions on the site. And it doesn't help that I'm not completely sure where I out my flutter sdk. Would like to know step by step what to do.
I had the same issue when i am working VS Code / flutter with ubuntu OS. every time shows the message flutter: command not found
. Then i set the path through VS Code integrated terminal. Please see the below screenshot.
I'm using macOS Catalina version- 10.15.7 and I have updated my $PATH
variable by following those steps:
echo $SHELL
in your terminal. It will tell you which shell you are using. macOS Catalina uses Z shell by default.
Output: /bin/zshecho $PATH
in your terminal and hit enter. It will show you the existing paths you have already set as path variable.
Output: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Apple/usr/bin.zshrc
file. In my case i'm using vim
editor. You can also use nano
or atom
editor. For opening the file type vi ~/.zshrc
in your terminal.i
for Insert mode.export PATH="$PATH:[your_flutter_sdk_path_here]/flutter/bin"
Esc
key then type :w
and hit Enter
key.Esc
key then type :x
and hit Enter
key.. ~/.zshrc
in your terminal.Now you can check your path variable by typing echo $PATH
in your terminal and hiting enter
key.
Output: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Apple/usr/bin:/Users/user/Documents/flutter/bin
Verify that the flutter command is available by running which flutter
in your terminal.
Output: /Users/user/Documents/flutter/bin/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