繁体   English   中英

如何解决 zsh: command not found: flutterfire in macOS?

[英]How can i resolve zsh: command not found: flutterfire in macOS?

我按照文档在我的 flutter 应用程序中添加了 firebase。 我收到 1 条警告和消息,例如

    Warning: Pub installs executables into $HOME/.pub-cache/bin, which is not on your path.
    You can fix that by adding this to your shell's config file (.bashrc, .bash_profile, etc.):
Warning: Pub installs executables into $HOME/.pub-cache/bin, which is not on your path.
You can fix that by adding this to your shell's config file (.bashrc, .bash_profile, etc.):

  export PATH="$PATH":"$HOME/.pub-cache/bin"

Activated flutterfire_cli 0.1.1+2.

在此之后我使用

flutterfire configure

我得到了这个错误(不是错误) zsh: command not found: flutterfire如何解决这个问题? 我这是任何环境错误吗?

通过运行命令 vim ~/.bash_profile 按 i 插入粘贴路径 export PATH="$PATH":"$HOME/.pub-cache/bin" 按 esc 键保存,然后按 :wq 退出

你可以运行 which flutterfire 来检查路径

在 Mac 上设置 zsh 的路径:

  1. 运行vim ~/.zshrc
  2. i
  3. 粘贴export PATH="$PATH":"$HOME/.pub-cache/bin"
  4. esc
  5. :wq! 然后按回车
  6. 重启终端

如果成功which flutterfire将起作用。

[我正在使用 Mac] 这对我有帮助,请记住,当您按照官方网站上的以下步骤操作时:-

 npm install -g firebase-tools
 firebase login
 dart pub global activate flutterfire_cli
 flutterfire configure


如果flutterfire configure不起作用,则添加:

export PATH="$PATH":"$HOME/.pub-cache/bin" 

从你的 Mac 的主目录到你的.bash_profile 现在,重新启动系统,打开系统后,在 VS Code 中再次尝试flutterfire configure 它会起作用的。 然后:

flutter pub add firebase_core
flutter pub get

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM