如何解决 macOS 中的 zsh: command not found: flutterfire 问题?

Vor*_*avi 24 firebase flutter

我按照文档在我的 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.
Run Code Online (Sandbox Code Playgroud)

之后我用了

flutterfire configure
Run Code Online (Sandbox Code Playgroud)

我收到此错误(不是错误)zsh: command not found: flutterfire 如何解决此问题?我这有什么环境错误吗?

Bug*_*ugs 98

在 Mac 上设置zsh的路径:

  1. 跑步vim ~/.zshrc
  2. i
  3. 粘贴export PATH="$PATH":"$HOME/.pub-cache/bin"
  4. esc
  5. 键入:wq!并按enter
  6. 重新启动终端

如果成功which flutterfire就会起作用。


小智 46

这对我有用: dart pub global run flutterfire_cli:flutterfire configure /sf/answers/5084845111/


Anu*_*rma 15

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

\n
 npm install -g firebase-tools\n firebase login\n dart pub global activate flutterfire_cli\n flutterfire configure\xe2\x80\xa8\n
Run Code Online (Sandbox Code Playgroud)\n

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

\n
export PATH="$PATH":"$HOME/.pub-cache/bin" \n
Run Code Online (Sandbox Code Playgroud)\n

.bash_profileMac 的主目录。\n现在,重新启动系统,打开系统后,flutterfire configure在 VS Code 中重试。它会起作用的。然后:

\n
flutter pub add firebase_core\nflutter pub get\n
Run Code Online (Sandbox Code Playgroud)\n


小智 1

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

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