Home > front end >  How do I get flutterfire configure command to work?
How do I get flutterfire configure command to work?

Time:10-24

I'm developing in flutter and am trying to add firebase to my flutter project.

Firebase login works, auth works, dart pub global activate flutterfire_cli works and flutterfire. I can call on firebase or flutterfire and it will list the options I have so I know the paths and installs are working.

But when I run flutterfire configure I always get this:

'''

flutterfire configure i Found 0 Firebase projects. 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. '''

I've been struggling with this for a few days now and have tried firebase binary, npm, nodejs, and anything else I can find. Nothing seems to be working.

Thanks ahead of time!

Lance

CodePudding user response:

I had the same issue some months Ago. This happens when you have ever initialise firebase on that project, be it for hosting , cloud function e.t.c.

Here is what you should do.

Firstly

Carefully delete files and folders relating to firebase-tools on that project (.firebase , firebase.json , .firebaserc ,functions(if available) and firebase_options.dart (if available));

You can then run your

dart pub global activate flutterfire_cli

flutterfire configure

then incase the you are using flutter web and you care to deploy on firebase hosting

You can now your

firebase init;

note:- firebase init; should on be done after flutterfire configure

  • Related