Can't access firebase command after install
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
@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)?
@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]?
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. :)
@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?
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.
@alexsandracodes Thanks for the feedback! That's really helpful, and I'll pass this along to the rest of the team.
so how did you fix it @alexsandracodes ????? same prob ty.
kindly tell me how did you resolve this problem i have install npm tool but i could not understand what is npm issue
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.
same for me http://stackoverflow.com/questions/38912491/bash-firebase-command-not-found
@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.
Thank you so much @flyingsriracha it worked.
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!
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 💃
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.
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.
Cheers @flyingsriracha those were exactly the steps I needed
None of this works. What do you have to do to get this running? What a joke.
This worked for me:
- Open cmd and cd C:\Program Files\nodejs
- npm install -g firebase-tools
- Restart your computer
- Open cmd and check firebase --version.
in cmd to check if it is installed and its version:
npm firebase -version