Code Monkey home page Code Monkey logo

Comments (48)

flyingsriracha avatar flyingsriracha commented on June 25, 2024 48

@tejasrsuthar
navigate to the firebase directory and call it out on the cmd. so
1.run cmd as admin
2. cd C:\users\yourusername\AppData\Roaming\npm
3. firebase.cmd login
or firebase login
there you go. above steps are all commands goes to your command prompt.

from firebase-tools.

danielcrowley avatar danielcrowley commented on June 25, 2024 33

SOLUTION
For those still having trouble, seems to be for me that where npm installs its packages has been lost as an environment variable.
If the package has been installed globally, it's normally in C:\Users\"yourname"\AppData\Roaming\npm
If you add that to your %PATH%, open a new cmd window, and you should be good to go.

from firebase-tools.

PercyPham avatar PercyPham commented on June 25, 2024 30

@vuabid has mentioned the way to fix the long path problem, but I will make it detail instruction for others:
(I'm using win 10)

  1. Open File Explorer (or simply press WindowButton + E).
  2. Right click on "This PC" => properties
  3. Look for "Advanced system settings" on the left side => click on that and it will open a popup
  4. Choose "Advanced" tab => Click on button "Environment Variables ..."
  5. In the "System variables" segment, look for variable "Path" => choose and click on "Edit" button
  6. Click "New" button and paste in the new line with this link:
    "C:\Users{yourUsername}\AppData\Roaming\npm"
    (Check the link in your PC for concise path)
    => Press Enter => OK => OK => OK
  7. Now you can open a new cmd, type in "firebase --version" and you will see the version of your firebase

from firebase-tools.

alexsandracodes avatar alexsandracodes commented on June 25, 2024 18

Yeah, definitely. I'm glad you ask. From my perspective, Firebase is a great tool for those who are not shy to pick up programming, but who are not necessarily knowledgeable of all the ins-and-outs. I've basically described myself, someone who wants a robust and easy to use tool that they can use without having to learn back-end programming in-depth. I feel like that aligns with Firebase's vision. That being said...

I like the clear and concise format of the guides, but there are cases where things are too simplified, and they don't actually work out for the user as simply as shown in the guide. Take for example, the hosting/deploy guide on firebase (https://www.firebase.com/docs/hosting/guide/deploying.html). It quickly tells you to install node.js and then run '$ npm install -g firebase-tools', and then '$ firebase init'. In theory, this processes should have been very easy for me, but instead it took a lot of times, weeks, to figure out what was going on behind the scenes with node.js and it's npm installer. It would be helpful if you could reference some guides for node.js and npm installer so that readers who are not familiar with the software and look it up. Basically, what I'm trying to say is, for the newbie who is picking up web dev for the first time, giving them a bigger picture of what the dependencies are (other software requirements) and some of the issues that they might occur along the way, would be helpful.

Also, it would be great if there was an option to export your documentation as a PDF or even a basic text file. As I recall, documentation for Firebase documentation is only accessable via the web.

from firebase-tools.

vedhaperi avatar vedhaperi commented on June 25, 2024 14

This worked for me:

  1. Open cmd and cd C:\Program Files\nodejs
  2. npm install -g firebase-tools
  3. Restart your computer
  4. Open cmd and check firebase --version.

from firebase-tools.

alexandlazaris avatar alexandlazaris commented on June 25, 2024 5

And within 8 minutes of posting I did it! Albeit ... not as I expected.

To use firebase at the moment, I must list the FULL directory path with each command. Meaning "firebase init" is now "C:\Users\name\AppData\Roaming\npm\firebase.cmd init"

Now I just realised, that's what you said @flyingsriracha 💃

from firebase-tools.

Dashing-Daniel-Li avatar Dashing-Daniel-Li commented on June 25, 2024 3

in cmd to check if it is installed and its version:
npm firebase -version

from firebase-tools.

eurolife avatar eurolife commented on June 25, 2024 2

like the above, I was only able to run it by typing the full path, ie; C:\Users\name\AppData\Roaming\npm\firebase init
Why is it like this when it is supposed to be easier by simply typing firebase init from within the project folder? And how can we fix things so that it is like this? Is that possible? Running Windows 7.

from firebase-tools.

m1is avatar m1is commented on June 25, 2024 2

None of this works. What do you have to do to get this running? What a joke.

from firebase-tools.

vuabid avatar vuabid commented on June 25, 2024 2

Add this path to Windows 10 Advance Settings "Environment Variables" PATH and then restart your system.
%USERPROFILE%\AppData\Roaming\npm\firebase;

from firebase-tools.

 avatar commented on June 25, 2024 1

Try to reinstall NodeJS that fixed this problem for me

from firebase-tools.

robertdimarco avatar robertdimarco commented on June 25, 2024

@alexsandracodes Apologies for the delayed reply. What can you tell us about the platform that you're running on (Win, OSX, Linux w/ version) in addition to the environment (Node and NPM versions)?

from firebase-tools.

robertdimarco avatar robertdimarco commented on June 25, 2024

@alexsandracodes From the StackOverflow, it looks like you're on Windows. If you've solved this, could you let us know how you resolved it? If not, could you reach out to me at [email protected]?

from firebase-tools.

alexsandracodes avatar alexsandracodes commented on June 25, 2024

Hey Robert! Thanks a lot for the response. Sorry I didn't notice it before. It wasn't actually an issue with firebase, it was an npm install issue. I got it figured out now. :)

from firebase-tools.

robertdimarco avatar robertdimarco commented on June 25, 2024

@alexsandracodes Ok, great! I'll close this issue out. Out of curiosity, is there anything that might be useful for us to document, in case others run into the issue?

from firebase-tools.

robertdimarco avatar robertdimarco commented on June 25, 2024

@alexsandracodes Thanks for the feedback! That's really helpful, and I'll pass this along to the rest of the team.

from firebase-tools.

ega123 avatar ega123 commented on June 25, 2024

so how did you fix it @alexsandracodes ????? same prob ty.

from firebase-tools.

itshasnainkhanofficial avatar itshasnainkhanofficial commented on June 25, 2024

kindly tell me how did you resolve this problem i have install npm tool but i could not understand what is npm issue

from firebase-tools.

tejasrsuthar avatar tejasrsuthar commented on June 25, 2024

Today I also got the same issue. @alexsandracodes would you please kindly let us know what steps did you follow in order to fix that issue? Thanks.

from firebase-tools.

developer-- avatar developer-- commented on June 25, 2024

same for me
http://stackoverflow.com/questions/38912491/bash-firebase-command-not-found

from firebase-tools.

tejasrsuthar avatar tejasrsuthar commented on June 25, 2024

Thank you so much @flyingsriracha it worked.

from firebase-tools.

alexandlazaris avatar alexandlazaris commented on June 25, 2024

Ahh this causes me so much pain! I had it working the very first time I installed firebase and ran login, deploy, etc.

After closing the PowerShell window I was using, I haven't been able to access firebase commands in any CLI (cmd, Git Bash, PowerShell or all as administrator). I have done the steps outlined by @flyingsriracha however it only gets me to 'login'. I can't do any other firebase commands in any other directory.

Please help! I've also installed latest firebase tools several times in each CLI with no luck (they install, I restarted and I still cannot access firebase commands). I am on Win 10.

Thanks!

from firebase-tools.

SaikCaskey avatar SaikCaskey commented on June 25, 2024

Cheers @flyingsriracha those were exactly the steps I needed

from firebase-tools.

dark-swordsman avatar dark-swordsman commented on June 25, 2024

Building off of what @danielcrowley said, make sure you EDIT your Path variable. Put a comma at the end and then paste the path, otherwise, you'll do what I just did and delete whatever else was in your path and overwrite it with your new npm path.

Whoops :(

from firebase-tools.

Mosanwar avatar Mosanwar commented on June 25, 2024

@danielcrowley it still not working for me

from firebase-tools.

A002465056 avatar A002465056 commented on June 25, 2024

Thank you so much @flyingsriracha it worked.

from firebase-tools.

Gideon1007 avatar Gideon1007 commented on June 25, 2024

@vedhaperi thank you so much ..

from firebase-tools.

LyndonMcjohnson avatar LyndonMcjohnson commented on June 25, 2024

bless you! @PercyPham

from firebase-tools.

VijayReddyDudipala avatar VijayReddyDudipala commented on June 25, 2024

This alone worked for me on Windows 10 system
npm install -g firebase-tools
Before trying this I used :
npm i g firebase-tools (just g instead of -g) and it was not working

from firebase-tools.

elebitzero avatar elebitzero commented on June 25, 2024

On Windows 10, Press Win+I to open the system settings dialog. In the search box type "environment" Choose "Edit Environment variables for your account"
Then add %USERPROFILE%\AppData\AppData\Roaming\npm to your Path environment variable.

from firebase-tools.

chunkingz avatar chunkingz commented on June 25, 2024

I think the main issue most people have is that when you navigate to C:\Users\USERNAME\appdata\Roaming\npm
"firebase" file and "firebase.cmd" file tend to be missing. I believe a re-install and reboot should fix it

from firebase-tools.

cnscorpions avatar cnscorpions commented on June 25, 2024

add env variable in path can fix it. and restart cmd. if you use some terminal emulator like fluent terminal, it may not recognize, just have a try at another one, like hyper terminal, or cmd, powershell

from firebase-tools.

Soumya1698 avatar Soumya1698 commented on June 25, 2024

@danielcrowley Thanks. Adding a globally installed package to the path of env variables helps.

from firebase-tools.

jag-chichria avatar jag-chichria commented on June 25, 2024

C:\users\yourusername\AppData\Roaming\npm

Alternatively, you can add this to your PATH using environment variables in windows.

from firebase-tools.

hanuz06 avatar hanuz06 commented on June 25, 2024

Add this path to Windows 10 Advance Settings "Environment Variables" PATH and then restart your system.
%USERPROFILE%\AppData\Roaming\npm\firebase;

Thank you very much. That worked for me.

from firebase-tools.

HassanAb0123 avatar HassanAb0123 commented on June 25, 2024

This worked for me "npm install -g firebase-tools"

from firebase-tools.

JigneshGothadiya avatar JigneshGothadiya commented on June 25, 2024

Some time when you install node it will update %PATH% for user environment variable but you have to add "C:\Users\username\AppData\Roaming\npm" path in %PATH% of system environment variable and then after restart you terminal or cmd and try "firebase init".

from firebase-tools.

justingolden21 avatar justingolden21 commented on June 25, 2024

I've tried changing the path variable, running from the npm directory, restarting, and everything else listed here. Still no luck.

It worked fine on another PC though.

from firebase-tools.

deepa-cv avatar deepa-cv commented on June 25, 2024

The "firebase login" command is not working for me.What do i do?

from firebase-tools.

markeu avatar markeu commented on June 25, 2024

likewise me, tried all the options stated here all to no avail

from firebase-tools.

harsh242 avatar harsh242 commented on June 25, 2024

I tried all the methods but I am still getting the same error.
firebase: command not found
Please help?

from firebase-tools.

sasuadrian avatar sasuadrian commented on June 25, 2024

For people who try all the methods and still getting the same error, the following steps works for me:

  1. run npm install -g firebase-tools
  2. In *C:* you will see a folder name usr. In the usr folder, copy the local folder and paste it in the C:\Users{PCName}\AppData\Roaming\npm.
  3. Rename the local with firebase.
  4. Enter in environment variables -> Path ->Edit -> New -> C:\Users{PCName}\AppData\Roaming\npm\firebase -> OK -> OK -> OK

And restart the PC

After restart, for testing if it work, enter in cmd and write firebase --version

from firebase-tools.

MuhammadFareed avatar MuhammadFareed commented on June 25, 2024

@tejasrsuthar
navigate to the firebase directory and call it out on the cmd. so
1.run cmd as admin
2. cd C:\users\yourusername\AppData\Roaming\npm
3. firebase.cmd login
or firebase login
there you go. above steps are all commands goes to your command prompt.

It is also not working!

from firebase-tools.

AnuragGorkar avatar AnuragGorkar commented on June 25, 2024

Thankyou @flyingsriracha that worked for me

from firebase-tools.

AssaultLemming avatar AssaultLemming commented on June 25, 2024

I have this problem, tried all the above steps, have the correct environment variables and no luck.

I see that firebase is contained within /users/appdata/roaming/npm/node_modules/firebase

How far down the directory tree should the Path variable be set? only to /npm ?

from firebase-tools.

Ashirkhan961 avatar Ashirkhan961 commented on June 25, 2024

I'm able to run the global install of firebase-tools:
$npm install -g firebase-tools
but then I try to run:
$ firebase init
and I get the error:

'firebase' is not recognized as an internal or external command, operable program, or batch file.

I would really appreciate anyone's help! I've also posted this on stackoverflow:
http://stackoverflow.com/q/29531235/4342441?stw=2

This is the answer!!
Set-ExecutionPolicy RemoteSigned

from firebase-tools.

Ashirkhan961 avatar Ashirkhan961 commented on June 25, 2024

I have this problem, tried all the above steps, have the correct environment variables and no luck.

I see that firebase is contained within /users/appdata/roaming/npm/node_modules/firebase

How far down the directory tree should the Path variable be set? only to /npm ?

Hii!

Just Run this command in your working directory.
Set-ExecutionPolicy RemoteSigned

from firebase-tools.

katowulf avatar katowulf commented on June 25, 2024

There are now an abundance of troubleshooting steps and solutions offered here. Locking this issue as further "me too" discussions aren't going to be findable or resolvable at this point. If you try the following steps and still have problems, file a separate issue with a minimal, complete, verifiable repro of the problem (logs, screenshots, steps, version info, os info, et al) that can be used for troubleshooting.

Ways to install the CLI (doc):
auto install script: curl -sL https://firebase.tools | bash
standalone binary: download here
npm version: npm install -g firebase-tools

Where the CLI executable is usually stored
Mac: /users/appdata/roaming/npm/node_modules/firebase
Windows: C:\users\yourusername\AppData\Roaming\npm or %USERPROFILE%\AppData\AppData\Roaming\npm

Potential solutions if your OS can't find the command

  1. If running env (mac) or echo %PATH% (windows) doesn't show the path to your CLI executable add it to your PATH environment variable (on windows: WIN+L to open settings, search for environment).

  2. Try running Set-ExecutionPolicy RemoteSigned so post

  3. Run it manually (just a temporary workaround, should not be necessary)

    1. run cmd as admin
    2. cd C:\users\yourusername\AppData\Roaming\npm
    3. firebase.cmd login or firebase login

After all solutions, you need to close the terminal / command prompt and restart it! Some users had to restart their computers before the changes took effect, but it's unclear if that's actually necessary.

from firebase-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.