firebaseflutterdart

FirebaseCommandException: An error occured on the Firebase CLI when attempting to run a command


Flutterfire just added a CLI for us to use, but I'm having a problem with the flutterfire configure command. I keep getting this error:

i Found 0 Firebase projects. Selecting project liveasy-1. 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.

Even though I've installed the Firebase CLI and can run firebase --version without any issues. I installed the standalone binary and when that didn't work I installed it with npm as well. I can log in and see my projects list, but running flutterfire configure seems to be an issue. I can't also access any Firebase commands in Visual Studio Code.

Am I supposed to add something to the PATH in environmental variables? I've already added the cache/bin/ where flutterfire resides, but I don't know how to do the same for Firebase.


Solution

  • I went through the same issue on Windows. I figured out that installing Firebase CLI using the binary file didn't work for me (even after Ventosus' answer), so here is my answer.

    I had to install the Firebase CLI using the npm command (Node.js is required to use this command):

    npm install -g firebase-tools
    

    I've then been able to run the command: flutterfire configure

    Here is the documentation you have to follow in case you don't have Node.js or if you need any information: Firebase CLI documentation