user40823
user40823

Reputation: 111

How do I get flutterfire configure command to work?

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

Upvotes: 1

Views: 9852

Answers (5)

hjtomi
hjtomi

Reputation: 19

  1. I have downloaded the firebase-cli with npm
  2. Then added "C:\Users\{username}\AppData\Roaming\npm" to PATH

Upvotes: 1

Chakib Temal
Chakib Temal

Reputation: 332

curl -sL https://firebase.tools | bash

firebase login

firebase projects:list

dart pub global activate flutterfire_cli

flutterfire configure --project=XXXXX

await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,);

Upvotes: 1

zufan
zufan

Reputation: 1

dart pub global activate flutterfire_cli

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

flutterfire configure

this works for me

Upvotes: 0

Yaoparfait48
Yaoparfait48

Reputation: 41

I had the same problem, I had to do the following commands in my project directory for it to work:

export PATH="$PATH":"$HOME/.pub-cache/bin"
dart pub global activate flutterfire_cli
flutterfire configure --project=project_name-genereted_firebaseapp_number

Upvotes: 3

Theodore MCA
Theodore MCA

Reputation: 1178

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

Upvotes: 9

Related Questions