''flutterfire configure' command not working, I need to set firebase in my flutter project
I followed "https://firebase.flutter.dev/docs/overview" instruction to set firebase in my flutter project.
step i took:
- "flutter pub add firebase_core" then dependencies were added, and generated_plugin_registrant.dart was created. generated_plugin_registrant.dart file
2) "dart pub global activate flutterfire_cli" it showed an warnign message ie "Warning: Pub installs executables into C:\Users\Asus\AppData\Local\Pub\Cache\bin, which is not on your path. You can fix that by adding that directory to your system's "Path" environment variable. A web search for "configure windows path" will show you how. Activated flutterfire_cli 0.1.1+2."
then i added "C:\Users\Asus\AppData\Local\Pub\Cache\bin" in system; "path" environment variable.
"flutterfire configure" now it gives error "bash: flutterfire: command not found".
Solution 1:[1]
Step by step commands for getting flutterfire work in Mac:
dart pub global activate flutterfire_cli
export PATH="$PATH":"$HOME/.pub-cache/bin"
curl -sL https://firebase.tools | bash
firebase login
flutterfire configure
Solution 2:[2]
I had the same problem. Following command worked for me.
flutterfire.bat configure
Solution 3:[3]
Here's a solution that worked for me:
From your terminal,open your bash profile in your home directory. Example home directory, Users/your-name/. I'm using macOS, so I typed typed the command sudo vim ~/.bash_profile from my home directory folder, followed by E to edit.
Scroll to the bottom of the file or below # Flutter ENV, on your keyboard, hit i to insert, then paste the following line, export PATH="$PATH":"$HOME/.pub-cache/bin". Press ESC, type ":wq!" then press Enter to save the changes and exit vim.
From the command line, reload your bash profile with source ~/.bash_profile. flutterfire configure should now work.
Solution 4:[4]
Hrishabh This worked for me.
Close your IDE. Restart IDE. Re-run "flutter pub add firebase_core" in your terminal. Finally run "dart pub global acttivate flutterfire_cli" in your terminal.
Solution 5:[5]
I had same problem and I solved this by:
- Added C:\Users<username>\AppData\Local\Pub\Cache\bin to Environment Path.
- Restarted IDE
- executed command : dart pub global activate flutterfire_cli
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Elmar |
| Solution 2 | Marsad |
| Solution 3 | Sharon |
| Solution 4 | Dharman |
| Solution 5 | Henry Ecker |
