I wanted to share a specific hurdle I encountered while working through the "Get to know Firebase for Flutter" codelab and explain how to resolve it. For context, I was using VS Code on Nobara OS.
Everything went smoothly from Step 1 through Step 3. However, I ran into a bit of trouble at Step 4, where you're required to add the FlutterFire libraries. If you're a beginner, you might struggle here because, while the documentation mentions the Firebase CLI, it’s easy to overlook the authentication requirements or the specific installation nuances.
If the CLI isn't set up correctly, running flutterfire configure will return an error in your terminal like this:
··• flutterfire configure
i Found 0 Firebase projects.
Failed to fetch your Firebase projects. Fetch failed with this: FirebaseCommandException: An error occured on the Firebase CLI when attempting to run a command.
COMMAND: firebase projects:list --json
ERROR: Failed to authenticate, have you run firebase login?
✔ Would you like to create a new Firebase project? · yes
✔ Enter a project id for your new Firebase project (e.g. my-cool-project) · fir-flutter-codelab-2d9cc
⠦ Creating new Firebase project fir-flutter-codelab-2d9cc...
FirebaseCommandException: An error occured on the Firebase CLI when attempting to run a command.
COMMAND: firebase projects:create fir-flutter-codelab-2d9cc --json
ERROR: Failed to authenticate, have you run firebase login?
The Fix
To resolve this, you first need to ensure Node.js is installed on your system. If you haven't set it up yet, you can find the installers at the official Node.js website.
Once Node.js is ready, run the following command to install the Firebase CLI globally: npm install -g firebase-tools
While there are other ways to install the Firebase CLI—such as using standalone binaries or auto-install scripts—I've found it much easier to maintain via npm. Using npm automatically sets up the firebase global command in your PATH.
In contrast, some binary scripts require you to manually configure your PATH or rename the file so that the terminal recognizes the firebase command. If the FlutterFire CLI can't detect that command, it will throw an error. Using npm simply makes it easier to manage and update in the long run.
Final Steps
After the installation is complete, make sure to run the login command in your terminal: firebase login
Once you've authenticated your Google account, you can proceed with flutterfire configure in your project directory. After getting past this CLI hurdle, the rest of the codelab went perfectly.
This article has been reviewed and refined with the assistance of NotebookLM to ensure technical accuracy and clarity.
Top comments (0)