7

I'm new in flutter I want to set flutter sdk path in Mac OS (VS code) for this I'm fallow the https://flutter.dev/docs/get-started/install/macos#update-your-path but when I run $HOME/.zshrc in Terminal It show error message zsh: permission denied: /Users/macbookpro/.zshrc I also apply this Terminal error: zsh: permission denied: ./startup.sh but this is not work for me.. can some one help me

Faiz E Qamar
  • 133
  • 1
  • 2
  • 11

4 Answers4

18

step.1

Open your terminal.

step.2

cd ~
vim .zshrc

step.3

Pass i to insert,and insert your flutter path(/bin:/Library/flutter/bin) behind .bin:$PATH/.

If you are done, press esc and enter :wq.

example

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH/bin:/Library/flutter/bin"
Daviswww
  • 371
  • 3
  • 9
7

If you want to evaluate its content inside your current zsh process, you can do a

source ~/.zshrc

You need to set the execute permission on the file, as you do for any other command which you want to execute, i.e.

chmod +x ~/.zshrc
1

For saving time, a little bit edited answer.

Commands in the terminal

cd ~
nano .zshrc

In the editor add path to the folder, for example

path+=('/usr/local/bin/ntfy')

Save, exit. Apply changes to current terminal

source ~/.zshrc

PS Check that in the file presents a line with export.

enter image description here

awaik
  • 10,143
  • 2
  • 44
  • 50
0

If you are using Apple Silicon and macOS Ventura, you can follow these steps:

  1. Open Terminal.

  2. Use the following command to open the .zshrc in the nano text editor:

nano .zshrc

  1. Add the Flutter path to the file by appending the following line:

export PATH="$PATH:/Users/{your_flutter_extracted_path}/bin"

  1. Save the changes by pressing CTRL + O, then exit Nano by pressing CTRL + X.

  2. To verify that the path has been added successfully, run the following command in the Terminal:

which flutter

It should display the path to Flutter similar to this:

/Users/{your_flutter_extracted_path}/bin/flutter

If you see the correct Flutter path, you are all set and ready to use Flutter on your Apple Silicon macOS Ventura setup!

Inod Umayanga
  • 114
  • 1
  • 7