'flutterfire : The term 'flutterfire' is not recognized as the name of a cmdlet, function, script file, or operable program

I am getting this error when I run "dart pub global activate flutterfire_cli" :

Activated flutterfire_cli 0.1.1+2. Package flutterfire_cli is currently active at version 0.1.1+2. Resolving dependencies... The package flutterfire_cli is already activated at newest available version. To recompile executables, first-run dart pub global deactivate flutterfire_cli. Installed executable flutterfire. Warning: Pub installs executables into C:\Users\PC\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

I have added this to my user path but I am still getting this error. I checked for solutionsto similar problems which suggested I restart the windows or vs code or terminal - I did all three but it is still not working . I ran in cmd in that it did not give the warning but when I ran flutterfire configure . It gave this error:

"FirebaseCommandException: An error occured on the Firebase CLI when attempting to run a command. COMMAND: firebase --version ERROR: The FlutterFire CLI currently requires the official Firebase CLI to also be installed, see https://firebase.google.com/docs/cli#install_the_firebase_cli for how to install it."

running firebase --version gave this error:

'firebase' is not recognized as an internal or external command, operable program or batch file

This should not be happening as I did connect my app to firebase console.



Solution 1:[1]

You have to add Flutter SDK path to your system environment. The error is arising because your system is not able to find the folder where you have installed Flutter in your system.

You may refer to the Stackoverflow case for the steps on how to set path for the system environment.

Alternatively, you may also refer to the video link.

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 Mousumi Roy