无法在macOS High Sierra上安装抖动

Jak*_*ake 2 macos terminal dart visual-studio-code flutter

我一直在此地址关注教程,但flutter doctor完成并成功运行后似乎仍然无法运行echo $PATH

我能想到的唯一原因是因为我可能最初需要将目录更改为flutter文件夹,而不是用户文件夹,但我怀疑这是否会带来真正的变化。

我已经联系了本教程的作者,他说另一个用户觉得这很有帮助。

I managed to solve it myself after I began looking into 'fish'. Apparently I had to declare the path in "~/.config/fish/config.fish" rather than "~/.bash_profile" and then of course run "source ~/.config/fish/config.fish" rather than "source ~/.bash_profile"

这是我的终端机的外观;

MacBook-Air:~ jake$ cd /users/jake/
MacBook-Air:jake jake$ touch .bash_profile
MacBook-Air:jake jake$ source $HOME/.bash_profile
MacBook-Air:jake jake$ echo $PATH
/flutter/bin:/flutter/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jake/.composer/vendor/bin:/Users      /jake/.composer/vendor/bin
MacBook-Air:jake jake$ flutter doctor
-bash: flutter: command not found
Run Code Online (Sandbox Code Playgroud)

我期待这样的事情; 扑医生的预期结果

非常感谢,杰克

Din*_*ian 6

快速解决:

  export PATH=$PATH:/Users/Jake/flutter/bin
  flutter doctor
Run Code Online (Sandbox Code Playgroud)

永久修复:

假设您使用的是bashShell,

  • cd $HOME
  • touch .bashrc 如果不在那里
  • 添加Quick fix line 1.bashrc文件中的最后一个
  • 打开新标签并检查flutter doctor。它应该工作

请让我知道它是否无效