Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

flutterfire configure fails with FirebaseCommandException from the Firebase CLI

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

Short answer

flutterfire configure runs the Firebase CLI underneath, so any CLI failure surfaces as FirebaseCommandException. Run the same CLI command by hand to see the real message. The usual causes are no login or an expired one, the CLI missing or too old, and a Node.js version below what the CLI requires.

  • Applies to firebase-tools, flutterfire_cli, Node.js 22
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    List your Firebase projects directly. This is a command the CLI runs for you, and its own error text is the real cause.

    firebase projects:list
  2. 2Match what you see, then jump to its fix

    1. 1The CLI says you must authenticate, or projects:list prints no projects you expectNot logged in, or the login expiredFix
    2. 2firebase: command not found, or an old CLI fails on a new project featureThe Firebase CLI is not installed, or it is outdatedFix
    3. 3npm or the CLI prints an engine or syntax errorNode.js is older than the CLI needsFix
    4. 4flutterfire: command not foundThe FlutterFire CLI is not activatedFix

What does the error look like?

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

Cause 1 of 4

Not logged in, or the login expired

1Check

See which Google accounts the CLI has.

firebase login:list

2Fix

Log in again with the account that owns the project, and switch to it if several are listed. On a remote machine without localhost access add --no-localhost.

firebase login
firebase login:use you@example.com

3Verify

projects:list shows the projects of that account, then retry the configure.

firebase projects:list
flutterfire configure

Confirmed by firebase.google.com

Did this fix it?

Cause 2 of 4

The Firebase CLI is not installed, or it is outdated

1Check

Check that the firebase command exists on PATH.

which firebase

2Fix

Install or update it with npm, or with the install script on macOS and Linux.

npm install -g firebase-tools

3Verify

The command resolves and lists projects.

firebase projects:list

Confirmed by firebase.google.com

Did this fix it?

Cause 3 of 4

Node.js is older than the CLI needs

1Check

The npm install of the CLI requires Node.js 18.0.0 or later.

node --version

2Fix

Upgrade Node.js, then reinstall the CLI.

npm install -g firebase-tools

3Verify

node reports 18 or later and the CLI runs.

node --version
firebase projects:list

Confirmed by firebase.google.com

Did this fix it?

Cause 4 of 4

The FlutterFire CLI is not activated

1Check

Check that Dart's global bin folder is on PATH and flutterfire resolves.

which flutterfire

2Fix

Activate the tool as the Flutter setup guide shows, then run configure from the project folder.

dart pub global activate flutterfire_cli
flutterfire configure

3Verify

configure lists your projects and writes lib/firebase_options.dart.

ls lib/firebase_options.dart

Confirmed by firebase.google.com

Did this fix it?

How do I stop it coming back?

  • Run firebase login:list before a setup session, especially on a machine you have not used for weeks.
  • Keep Node.js and firebase-tools updated together.
  • In CI, use a service account through GOOGLE_APPLICATION_CREDENTIALS instead of an interactive login.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

FCM says the token is not found when you send a push

UNREGISTERED

The FCM HTTP v1 API returns UNREGISTERED with HTTP 404 when the app instance behind a token is gone: the app was uninstalled, the token expired, the client unregistered, or the token you pass is empty.

2 causes, each with a fix

Mobile apps

firebase projects:create or flutterfire configure says 'Failed to create project'

Error: Failed to create project. See firebase-debug.log for more info.

A Firebase project is a Google Cloud project, so creation fails on the same rules: the ID must be 6 to 30 lowercase characters and never used before (deleted projects count), your account must be allowed to create projects, and you must be under the project limit.

3 causes, each with a fix

Mobile apps

The iOS push arrives from FCM but plays no sound

A custom sound name in the payload is ignored and nothing plays

iOS plays a sound for a remote notification only when the aps payload has a sound key and the app is allowed to play sounds.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.