Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to login Firebase with cli command

I'm trying to login to my Firebase account with cli command firebase login. I believe it should open browser and prompt me to login with my google account, but that doesn't seem to happen.

Instead, it's asking me to enter my email and password in the terminal. Once I enter my credentials, it throws the following error:

/usr/lib/node_modules/firebase-cli/node_modules/source-map-support/source-map-support.js:223 return '\n at ' + wrapCallSite(frame); ^ TypeError: CallSite method toString expects CallSite as receiver

How do I fix this as I want to deploy my app to Firebase?

like image 554
Vinay Sharma Avatar asked Feb 01 '20 11:02

Vinay Sharma


People also ask

What is firebase CLI?

The Firebase CLI (GitHub) provides a variety of tools for managing, viewing, and deploying to Firebase projects. Before using the Firebase CLI, set up a Firebase project.

How do you check firebase CLI is installed?

Run firebase tools --version to check version. And as per the prompt, run npm install -g firebase-tools to update.

How do I log into firebase server?

To sign a user into your app, you first get authentication credentials from the user. These credentials can be the user's email address and password, or an OAuth token from a federated identity provider. Then, you pass these credentials to the Firebase Authentication SDK.

How do I use Firebase CLI?

The Firebase Command Line Interface (CLI) Tools can be used to test, manage, and deploy your Firebase project from the command line. To get started with the Firebase CLI, read the full list of commands below or check out the documentation. You can install the Firebase CLI using npm (the Node Package Manager).

How do I fix Firebase command not found?

To solve the error "firebase: command not found", install the firebase cli package globally by running npm install -g firebase-tools and restart your terminal. If the command fails, run it with sudo and make sure the correct PATH is set in your system's environment variable.

What are the most common Firebase CLI errors?

firebase CLI will not recognize current directory for 'firebase init' 1 Permission access error while installing Firebase tools/CLI 10 Unable to login Firebase with cli command 0 Firebase CLI Unexpected token

What to do if the global installation of Firebase fails?

If the global installation of Firebase fails, you might have to run the command prefixed with sudo. If the "firebase: command not found" error is not resolved, try restarting your terminal. The command will show you the path where npm puts your globally installed packages.


Video Answer


2 Answers

I've had the same issue.

You're probably using firebase-cli instead of firebase-tools. https://firebase.google.com/docs/cli#update-cli

firebase-cli has been deprecated years ago.

@mikeonline did you ever installed the Firebase tools/cli before on your machine (before we launched v3 at Google IO) basically did you have v2.2 previously installed perhaps?

firebase-cli has been deprecated a year ago and only installs v1. NPM should have printed this message"

npm WARN deprecated [email protected]: Use firebase-tools instead. Both v2 and v3 can be installed with npm install -g firebase-tools but by default the latest version (3.0.0) gets installed.

https://github.com/firebase/codelab-friendlychat-web/issues/22#issuecomment-220695413

like image 196
Updates Avatar answered Sep 20 '22 13:09

Updates


Execute the below command

npm uninstall firebase-cli
npm uninstall firebase-tools
npm install -g firebase-tools --force
like image 34
Himanshu Sharma Avatar answered Sep 20 '22 13:09

Himanshu Sharma