CLI login fails with an Error to make a request message
[REQUIRED] Environment info
firebase-tools: 11.0.1
Platform: macOS {11.6.1 (20G224)}
[REQUIRED] Test case
- Download
firebase-toolsorfirebase-cliand authenticate from the terminal (Alacritty, default MacOS terminal, ZSH shell)
[REQUIRED] Steps to reproduce
- Download Firebase-tools or Firebase-cli package from either npm or brew.sh respectively;
- Execute
firebase login,firebase login --reauth,firebase login --no-localhostand basically all versions of authentication available. Including ones with login:ci
[REQUIRED] Expected behavior
- CLI tool authenticates
[REQUIRED] Actual behavior
The following is the output of firebase login --debug
~ ❯ firebase login --debug
i Firebase optionally collects CLI usage and error reporting information to help improve our products. Data is collected in accordance with Google's privacy policy (https://policies.google.com/privacy) and is not used to identify you.
? Allow Firebase to collect CLI usage and error reporting information? (Y/n) [2022-05-27T11:25:42.298Z] FetchError: request to https://firebase-public.firebaseio.com/cli.json failed, reason: unable to get local issuer certificate
at ClientRequest.<anonymous> (/usr/local/Cellar/firebase-cli/11.0.1/libexec/lib/node_modules/firebase-tools/node_modules/node-fetch/lib/index.js:1491:11)
at ClientRequest.emit (node:events:390:28)
at ClientRequest.emit (node:domain:475:12)
at TLSSocket.socketErrorListener (node:_http_client:442:9)
at TLSSocket.emit (node:events:390:28)
at TLSSocket.emit (node:domain:475:12)
at emitErrorNT (node:internal/streams/destroy:164:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Error: Failed to make request to https://firebase-public.firebaseio.com/cli.json
~ ❯
A temporary fix export NODE_TLS_REJECT_UNAUTHORIZED=0 worked for me.
- I'm unable to support/test the
firebase-clibrew package version since it being wrapped in whatever brew does isn't something we control - sorry. - What version of node are you using?
- It's very likely that this has something to do with your local setup. From the same machine, do you have any issues curl-ing or opening
https://firebase-public.firebaseio.com/cli.jsonin a browser?
A temporary fix
export NODE_TLS_REJECT_UNAUTHORIZED=0worked for me.
Worked for me. Thanks @ArcherN9
It's very likely that this has something to do with your local setup.
@bkendall Yes, it does appear so. My work laptop has all sorts of proxies/DNS restrictions in place. I recently formatted my system and did not install the proxies - It works as expected now.
What version of node are you using?
v18.2.0
do you have any issues curl-ing or opening https://firebase-public.firebaseio.com/cli.json in a browser?
Nope. That was the weird part - I was able to curl it, wget and open it on a browser. Just not when firebase cli executes it.
I concede there are things beyond what I understand about the whole Firebase CLI/brew system. But perhaps we could add this to the documentation somewhere?
Glad it's cleared up!
A temporary fix
export NODE_TLS_REJECT_UNAUTHORIZED=0worked for me.
Thank you @ArcherN9 , I have another error related to the self signed certificate and this workaround helped me to run firebase login:ci successfully
firebase login:ci --debug
......
[2023-11-06T03:12:16.990Z] *** [apiv2] error from fetch(https://accounts.google.com/o/oauth2/token, {"headers":{},"method":"POST","body":{"_overheadLength":655,"_valueLength":214,"_valuesToMeasure":[],"writable":false,"readable":true,"dataSize":0,"maxDataSize":2097152,"pauseStreams":true,"_released":true,"_streams":[],"_currentStream":null,"_insideLoop":false,"_pendingNext":false,"_boundary":"--------------------------39405827254123229384288","_events":{},"_eventsCount":1}}): FetchError: request to https://accounts.google.com/o/oauth2/token failed, reason: self signed certificate in certificate chain
......
- I'm unable to support/test the
firebase-clibrew package version since it being wrapped in whatever brew does isn't something we control - sorry.- What version of node are you using?
- It's very likely that this has something to do with your local setup. From the same machine, do you have any issues curl-ing or opening
https://firebase-public.firebaseio.com/cli.jsonin a browser?
I have the same issue and when I open .json with curl this was the response
{"cloudBuildErrorAfter":1594252800000,"cloudBuildWarnAfter":1590019200000,"defaultNode10After":1594252800000,"minVersion":"3.0.5","node8DeploysDisabledAfter":1613390400000,"node8RuntimeDisabledAfter":1615809600000,"node8WarnAfter":1600128000000}
also this not worked for me
export NODE_TLS_REJECT_UNAUTHORIZED=0
firebase version is 13.3.0 on mac os version 14.1
I don't know what should I do if it something related to my network or my device
@abdullahalamodi i am also facing the same issue as you, have you found any solution for this? and this was the response when I open .json with curl "cloudBuildErrorAfter 1594252800000 cloudBuildWarnAfter 1590019200000 defaultNode10After 1594252800000 minVersion "3.0.5" node8DeploysDisabledAfter 1613390400000 node8RuntimeDisabledAfter 1615809600000 node8WarnAfter 1600128000000" same as you and also this "export NODE_TLS_REJECT_UNAUTHORIZED=0" command doesnt worked for me.
i have tried to deploy a firebase function but got some permission error and when i logged out from cli and thn tried to login again i got error.
🚨 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! 🚀