How to update path of flutter in macos?

wal*_*l-e 1 macos terminal flutter

Hey I just installed flutter and did everything as in this video: https://www.youtube.com/watch?v=U4TJ5ITGe5Y and also as told on the website: https://docs.flutter.dev/get-started/install/macos#update-your-path.

To update the path of flutter I put this command in the .zshrc file.

export PATH="$PATH:[PATH_OF_FLUTTER_GIT_DIRECTORY]/bin"
Run Code Online (Sandbox Code Playgroud)

However it doesn't work. Does anybody have an idea what I could be doing wrong?

Thanks a lot and have a nice day!

Nav*_*mar 11

将 FLUTTER PATH 永久添加到终端

\n

步骤1

\n

类型: echo $SHELL

\n
    \n
  • 这将告诉您正在使用哪个 SHELL(bash 或 Z shell)
  • \n
\n

步骤:2 \xe2\x80\xa8

\n

类型:$HOME/.bashrc

\n
    \n
  • 如果显示文件不存在,则需要创建新的 zshrc 文件
  • \n
\n

(仅当出现上述错误时) TYPE: touch ~/.zshrc // 这将创建一个新的 zshrc 文件

\n

步骤3:

\n

TYPE: open $HOME/.zshrc //打开zshrc文件

\n
    \n
  • 在zshrc文件中添加永久设置到终端的flutter bin路径
  • \n
\n

类型:export PATH="$PATH:$HOME/development/flutter/bin"

\n

步骤4:

\n

TYPE: source $HOME/.zshrc//刷新当前终端窗口

\n

现在您可以随时运行 flutter cmd,而无需添加路径

\n

  • 工作了。非常感谢 (2认同)