简体   繁体   中英

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

I followed document to add firebase in my flutter app. I got 1 warning and message like

    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.

after this i used

flutterfire configure

and i got this error (not an error) zsh: command not found: flutterfire How to resolve this? and I this any environment error?

set path to flutterfire by running command vim ~/.bash_profile press i for insert paste the path export PATH="$PATH":"$HOME/.pub-cache/bin" press esc key to save then :wq to exit

you can run which flutterfire to check path

Set path for zsh on Mac:

  1. Run vim ~/.zshrc
  2. Press i
  3. Paste export PATH="$PATH":"$HOME/.pub-cache/bin"
  4. Press esc
  5. Type :wq! and press enter
  6. Restart the terminal

If successfull which flutterfire will work.

[I am using Mac] This helped me, Just keep in mind when you follow below steps from officialwebsite :-

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


If flutterfire configure doesnot work then, Add:

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

to your .bash_profile from Home directory of your mac. Now, Restart your system, And after opening your system, try flutterfire configure again in VS Code. It will work. Then:

flutter pub add firebase_core
flutter pub get

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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