flutter 安装失败sudo: flutter: command not found

1、下载flutter:

git clone -b beta https://github.com/flutter/flutter.git

由于国内原因可能会下载失败

我是使用vpn之后下载成功的:名字叫VPN PLUS免费的,

 

2、下载成功后输入flutter doctor:zsh: permission denied: flutter  在命令行前面加一个 sudo flutter doctor即可

 

3、输入第二步的时候报错:sudo: flutter: command not found  经过查找原因是我的.bash_profile文件的路径设置错误

 

  我之前由于设置错误所以报了这个错, 如果你也出现这个错误可能是这个原因,查看一下你的path是否设置正确,

mac终端打开.bash_profile命令:open ~/.bash_profile

让.bash_profile生效的命令是:source .bash_profile;


版权声明:本文为hello_cwt原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。