作者:huanhuan199538 | 来源:互联网 | 2022-12-06 16:36
我一直在此地址关注教程,但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
我期待这样的事情;
非常感谢,杰克
1> Dinesh Balas..:
快速解决:
export PATH=$PATH:/Users/Jake/flutter/bin
flutter doctor
永久修复:
假设您使用的是bash
Shell,
cd $HOME
touch .bashrc
如果不在那里
添加Quick fix line 1
为.bashrc
文件中的最后一个
打开新标签并检查flutter doctor
。它应该工作
请让我知道它是否无效