2
votes

how do i login to firebase on windows power shell? i just started using firebase for app deployment. after i install firebase CLI using npm install -g firebase-tools and the installation was succeessful, but when i tried to login using firebase login in my site directory, i got this message

"PS C:\Users\Dennis\friendlychat\web-start> firebase login The term 'firebase' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:9 + firebase <<<< login + CategoryInfo : ObjectNotFound: (firebase:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException"

note: i"ve set the environment path for nodejs and npm cmd are working>

8
I was trying this as well in windows 10, but firebase was never recognized for me in Powershell. Once i tried in the normal windows cmd prompt it worked just fine. Idk if its just powershell not grabbing all the environment variables or what it is, but the cmd prompt worked for all things firebase. - Nicholas Pesa

8 Answers

5
votes
  1. Install firebase tools. Use: npm install -g firebase-tools
  2. Login using: firebase login
  3. Initialize your firebase: firebase init In this step you need to select your firebase account and the application folder you want to deploy on firebase.
  4. Then to deploy the code: firebase deploy

PS: You should build your application before step 2.

2
votes

The issue is that your Nodejs data folder path hasn't been added to your windows environment variables and the.

  1. Open windows 'environment variables'.
  2. Under 'system variables' look for variable 'Path'
  3. Select variable 'Path' and choose 'edit'
  4. From the dialog choose 'new' and paste %USERPROFILE%\AppData\Roaming\npm\
  5. Apply changes and restart PowerShell

You're good to go!

1
votes

While installation, Firebase will print messages like this:

PS C:\Program Files\nodejs> npm install -g firebase-tools
npm WARN deprecated [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
C:\Users\your_id\AppData\Roaming\npm\firebase -> C:\Users\your_id\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase
C:\Users\your_id\AppData\Roaming\npm
`-- [email protected]

Now go into the working directory, and input commands like this:

PS F:your_working_dir> C:\Users\your_id\AppData\Roaming\npm\firebase login
PS F:your_working_dir> C:\Users\your_id\AppData\Roaming\npm\firebase init
PS F:your_working_dir> C:\Users\your_id\AppData\Roaming\npm\firebase deploy

Other methods, try restarting your systems after npm install, or, change SYSTEM VARIABLES. I read it some posts that using Windows Command Prompt instead of Power Shell might also work. Try and post which method worked for you.

0
votes

I had a similar problem, What worked for me was changing my directory to C:\Users\your_id\AppData\Roaming\npm\ And running the commands.

0
votes
  • Open your terminal and type npm ls -g --depth=0
  • Copy the path, mine is C:\usr\local
  • Close your terminal
  • Add the path to path in user environment variables
  • Reopen your terminal
  • Type cd /
  • Type cd usr\local (Assume you are you using my path)
  • Finally, Type firebase.cmd login

If you are still confused, check this YouTube video https://www.youtube.com/watch?v=sFrfhJXd_EE

0
votes

had similar issue, If you had used yarn to install firebase-tools, try using npm install -g firebase-tools

0
votes

This will work. open your terminal and write:

npm ls -g --depth=0

it will give you your directory copy that and then search for environment variables and then go to the path and add click to add option and then paste it.

then reopen your terminal and write:

firebase.cmd login

it will work. you were getting the error because your directory was wrong under the environment variables.

0
votes

I had a similar problem, What worked for me was changing my directory to C:\Users\your_id (Mr.DM)\AppData\Roaming\npm

But you have to name it PATH