[英]flutter doctor 'zsh: command not found'
我已经安装了 flutter 并使用zsh
文件为 mac 的 Catalina 版本设置了路径,但是当我运行 flutter doctor 或 flutter precache 时,我收到zsh
: command not found: flutter。 注意:我之前设法完成了这些步骤并设置了 android studio,但是当我尝试为 Xcode 连接模拟器时遇到了问题,现在我不得不重新开始。
更新:运行“颤振”或“颤振医生”时,我收到此错误: Error when reading '../../../../documents/flutter/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot': No such file or directory
,它说 10 次尝试后pub upgrade
失败。 我将如何解决这个问题?
当我在主目录中运行ls -a
时,我看到那里有一个 .bash_profile、一个 .zshrc 文件和一个 .zprofile(我之前创建的)。 这与问题有关吗?
看起来您在 ZSH 中的 PATH 上没有抖动。
在终端中打开.zshrc
文件
nano .zshrc
您应该在文件顶部看到以下内容
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
在第二行添加 Flutter SDK 位置的 bin 目录路径,就像我的一样:
export PATH=$HOME/bin:/usr/local/bin:$PATH:/Users/joaosoares/Projects/flutter/bin
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.