firebase 如何解析zsh:找不到命令:macOS中的flutterfire?

guykilcj  于 2022-11-17  发布在  Mac
关注(0)|答案(5)|浏览(488)

我按照文档添加firebase在我的flutter应用程序。我得到了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如何解决这个问题?我这任何环境错误?

cnjp1d6j

cnjp1d6j1#

在Mac上设置zsh的路径:
1.运行vim ~/.zshrc
1.按i
1.粘贴export PATH="$PATH":"$HOME/.pub-cache/bin"
1.按下esc
1.键入:wq!并按Enter键
1.重新启动终端
如果成功,which flutterfire将工作。

1qczuiv0

1qczuiv02#

[我正在使用Mac]这帮助了我,只要记住,当你按照以下步骤从官方website:-

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


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

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

到你的.bash_profile从你的mac的主目录。现在,重新启动你的系统,并打开你的系统后,再次尝试flutterfire configure在VS代码。它会工作。然后:

flutter pub add firebase_core
flutter pub get
isr3a4wc

isr3a4wc3#

以下是对我有效的方法:dart pub global run flutterfire_cli:flutterfire configurehttps://stackoverflow.com/a/72640644/20406073(单位:千美元)

2cmtqfgy

2cmtqfgy4#

通过运行命令vim ~/.bash_profile设置flutterfire的路径按i插入粘贴路径导出PATH="$PATH”:“$HOME/.pub-cache/bin”按Esc键保存然后:wq退出
你可以运行flutterfire来检查路径

z9smfwbn

z9smfwbn5#

[

1.执行vim ~/.zshrc
1.按i
1.粘贴抖动/bin路径,如图所示
1.粘贴导出路径="$PATH”:“$HOME/.pub-cache/bin”
1.按Esc键
1.键入:wq!并按Enter键
1.重新启动终端

相关问题