firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

Firebase Login CLI Issue

Open tomwalsh96 opened this issue 4 years ago • 12 comments

[REQUIRED] Environment info

firebase-tools: 10.6.0

Platform: Windows

[REQUIRED] Steps to reproduce

I had an issue trying to use firebase init, it encountered an error trying to find existing projects in the CLI.

I looked for a solution and found suggestions that "when you upgrade firebase-tools, that may invalidate your auth token". The suggestion was to logout and log back in.

Upon attempting to log back in, I am first prompted with: Allow Firebase to collect CLI usage and error reporting information? (Y/n)

After making my selection, this is the debug output: image

I attempted to update Node and Firebase with no luck, I am now stumped. Thanks for taking a look.

tomwalsh96 avatar Apr 08 '22 18:04 tomwalsh96

This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Apr 08 '22 18:04 google-oss-bot

Update

After a new day of being stumped, I found that I could run firebase login --no-localhost

I was able to complete the login process through this command.

Maybe the issue has something to do with my browser? I'm using Chrome Version 99.0.4844.74 (Official Build) (64-bit)

Hope this helps in some way

tomwalsh96 avatar Apr 09 '22 23:04 tomwalsh96

Update

I now have a new error when running firebase init, identical to #4254 which still does not seem to be fixed.

As per the suggestion in that thread, I reverted to 10.1.5, still no luck. I can't even log in at all now.

tomwalsh96 avatar Apr 10 '22 00:04 tomwalsh96

Idea: looks like the CLI is breaking when it tries to open a browser window. A stopgap solution could be to:

  1. Print the sign-in URL before trying to spawn the browser (it does get printed usually, but looks like it crashed before it was able to)
  2. try-catch the spawn command so the CLI doesn't crash

jhuleatt avatar Apr 11 '22 20:04 jhuleatt

To help me debug, how did you install the CLI on your Windows machine, and in what terminal are you using it?

bkendall avatar Apr 18 '22 20:04 bkendall

hello, I'm in bandwagon when it comes to this problem: [firebase init firestore not work with existing project] I'm using firebase CLI version 10.6.0

but somehow I manage to deal with it, here's my solution/timeline:

  1. I install using firebase login --no-localhost because encounter problems with firebase login
  2. encountered with errors: cannot install firestore but hosting part can.
  3. try to reset database, created again but still get error: cannot install firestore
  4. then I logout, then login using ONLY firebase login, not the firebase login --no-localhost
  5. bang! solved!

hope it helps~

ruhaifie avatar Apr 19 '22 08:04 ruhaifie

Hi, can folks on this thread with --no-localhost issues try firebase login --no-localhost --reauth and see if things are different? We have fixed a bug where an OAuth scope required by certain commands was not included in the updated flow released in February.

mbleigh avatar Apr 20 '22 18:04 mbleigh

To help me debug, how did you install the CLI on your Windows machine, and in what terminal are you using it?

I installed using npm install -g firebase-tools.

For the terminal, I'm using PowerShell, both standalone and through VSCode it fails.

tomwalsh96 avatar Apr 27 '22 11:04 tomwalsh96

Hi, can folks on this thread with --no-localhost issues try firebase login --no-localhost --reauth and see if things are different? We have fixed a bug where an OAuth scope required by certain commands was not included in the updated flow released in February.

Ah brilliant this seems to have worked, thanks!

firebase login still fails but I can use this as a workaround for now.

tomwalsh96 avatar Apr 27 '22 11:04 tomwalsh96

I had tried installing the latest firebase-tools in powershell yesterday, but didn't have any luck. Since --no-localhost (and --reauth) worked for you, I think that's the best path forward. It's likely something's failing when it tries to open the browser from powershell, but without being able to reproduce it, there's not much I can to.

Glad you're back up and running though!

bkendall avatar Apr 27 '22 16:04 bkendall

Thanks, I also tried running firebase login from CMD but got the same issue so I would guess not a PowerShell problem.

tomwalsh96 avatar Apr 27 '22 16:04 tomwalsh96

🚨 IMPORTANT UPDATE FOR EVERYONE FACING FIREBASE LOGIN ERRORS 🚨

If you are getting any of the following errors while using Firebase CLI, Flutter, Android Studio, PowerShell, or Command Prompt, then this solution may help you:

❌ Authentication Error: Your credentials are no longer valid. Please run firebase login --reauth

❌ Error: Unable to authenticate using the provided code. Please try again.

❌ Firebase CLI Login Failed

❌ Firebase Authentication Error

❌ Firebase Login Not Working

❌ Firebase Login Authorization Failed

❌ Firebase Login Session Expired

❌ Firebase Login Reauthentication Failed

❌ Firebase CLI Unable to Authenticate

❌ Firebase Login Token Expired

❌ Firebase Login Browser Authentication Failed

I personally faced this problem while configuring Firebase for my Flutter project. I spent a lot of time trying different commands, reinstalling Firebase CLI, and repeating the login process, but the issue continued. After testing multiple solutions, I finally found a working fix.

🎥 COMPLETE SOLUTION VIDEO:

👉 https://youtu.be/oP3w_OI435s?si=yBOXlHJWGEk4oO2C

Watch the video carefully and follow every step exactly as shown.

This solution may help if you are facing issues while running:

✔ firebase login

✔ firebase login --reauth

✔ firebase login --debug

✔ firebase logout

✔ firebase init

✔ firebase deploy

✔ firebase projects:list

✔ flutterfire configure

✔ npm install -g firebase-tools

Common searches that may bring you here:

firebase login error

firebase authentication error

firebase cli login failed

firebase login unable to authenticate

firebase login credentials are no longer valid

firebase login reauth not working

firebase login authorization code invalid

firebase login browser issue

firebase login powershell error

firebase login windows 11 error

firebase login windows 10 error

firebase login android studio error

firebase login flutter error

firebase deploy authentication failed

firebase init authentication failed

firebase tools login issue

firebase oauth error

firebase cli authentication failed

firebase login code rejected

firebase login token expired

firebase login session invalid

firebase login after entering authorization code error

firebase login command prompt error

firebase login stuck after browser authentication

firebase login not accepting code

firebase cli latest version login issue

firebase login 2026

firebase login fix 2026

firebase authentication solution

firebase login complete fix

⚠️ Before commenting "Not Working", please mention:

1️⃣ Your Operating System (Windows 10 or Windows 11)

2️⃣ Firebase CLI Version Run: firebase --version

3️⃣ Node.js Version Run: node --version

4️⃣ Exact Error Message

5️⃣ Screenshot of the Error (if possible)

This helps me understand the issue faster and provide a better solution.

📧 For additional assistance:

[[email protected]](mailto:[email protected])

I regularly check comments and emails and try to help developers facing Firebase, Flutter, Android Studio, Firebase CLI, Authentication, Deployment, Firestore, Hosting, and FlutterFire configuration issues.

If this solution helped you, please:

👍 Like the video

💬 Comment "Solved"

📢 Share it with other Flutter developers

🔔 Subscribe for more Firebase and Flutter tutorials

Happy Coding! 🚀

flutter-for-developers avatar Jun 23 '26 06:06 flutter-for-developers