firebase-tools “-bash: firebase: command not found”

匿名 (未验证) 提交于 2019-12-03 01:14:02

问题:

Excited that Firebase's hosting is now out of beta. Trying to get going with with the firebase-tools package and I've successfully installed it:

npm install -g firebase-tools 

Trying to run any tool fails with

-bash: firebase: command not found 

I've tried putting the following command in my .bash_profile without any luck

export PATH=/usr/local/share/npm/bin:$PATH 

Any ideas? Pretty new to the command line in general.

Thanks!

回答1:

@mklement0 That answer looks good, but I'm worried it will be intimidating to someone who is so new to the command line. So I'm going to cherry-pick the most relevant piece of it.

@cienki Run this command to see what you should be putting in that PATH prefix in your .bash_profile file:

npm get prefix 


回答2:

Run code below with terminal,

alias firebase="`npm config get prefix`/bin/firebase" 


回答3:

You should add the npm bin folder to your bash PATH variable. To do that, run:

npm get prefix 

And it should output something like /home/your-username/npm-global.

Then in your ~/.bashrc or ~/.bash_profile (if you're in a Mac) file, add:

export PATH="/home/your-username/npm-global/bin:$PATH" # Add npm bin PATH 

Note the "/bin" after the npm get prefix result.



回答4:

Installing firebase-tools globally did the trick for me :

npm install -g firebase-tools 


回答5:

Bruno's answer did the trick, I only needed to add a dot at npm-global in Ubuntu in .bashrc:

export PATH="/home/your-username/.npm-global/bin:$PATH" # Add npm bin PATH 


回答6:

Simply reinstall node.js. This worked for me and fire command was recognized.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!