zsh: command not found: flutter

安装flutter以后很多同学使用的临时路径  每次打开终端都需要重新export 路径

设置永久路径也没少爬坑,现在给出我的解决方案:

终端:open $HOME/.bash_profile

打开后添加:

export PATH=~flutter/bin:$PATH        //(此路径为本地flutter路径)

//下面为本来就有的东西

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

关闭,然后终端:source $HOME/.bash_profile

接着终端:open ~/.zshrc 

在最上面添加:

# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.

source ~/.bash_profile

关闭,然后终端:source ~/.zshrc 

然后就可以随意flutter命令了

如果还不行:

终端:open ~/.bashrc 

改成这样:

# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.

export PATH=~/flutter/bin:$PATH        //(此路径为本地flutter路径)

关闭,然后终端:source ~/.bashrc

$HOME/.bash_profile      ~/.bashrc   两个文件改其一就可以  

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容