6

I need to host website to google firebase hosting. I looked almost everywhere but steel have the problem. I have installed npm install --global firebase also npm install -g firebase-tools but when I want to use firebase command it says : "command not found"

firebase-tools "-bash: firebase: command not found"

Firebase Hosting set up issue

https://github.com/firebase/firebase-tools/issues/46

this posts didn't helped

enter image description here

this is after sudo npm install --global firebase-tools

enter image description here

Community
  • 1
  • 1
  • 1
    Installing NPM modules globally with sudo can lead to weird behaviour. If I were experiencing your problem, that's the first thing I'd look into. There is a guide [here](https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md). – cartant Aug 12 '16 at 07:49

3 Answers3

20
alias firebase="`npm config get prefix`/bin/firebase"
Benny Powers
  • 5,398
  • 4
  • 32
  • 55
  • this doesn't fix the issue though... what does it do? and what do you have to do next? – AndrewNeedsHelp Jul 11 '20 at 17:43
  • this sets the command firebase to execute the file at (whatever your npm binary prefix is)/bin/firebase if this doesn't work, you have to `npm i -g firebase-tools` first – Benny Powers Jul 11 '20 at 17:55
2

I forgot to install Firebase Tools after a long time away from it on new computer... Use npm i firebase --save to set your project up and npm install -g firebase-tools to install the tools for e.g. serving your app locally, etc.

ravo10
  • 895
  • 9
  • 18
0

In macOS:

You can use this query

curl -sL https://firebase.tools | bash
Anil Kumar
  • 1,830
  • 15
  • 24