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

前端 未结 21 1652
野趣味
野趣味 2020-11-29 01:15

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 instal         


        
相关标签:
21条回答
  • 2020-11-29 01:32

    This worked for me on Mac (same thing the others have been posting above, just for Mac):

    1. go to your home folder in Finder (named after your user name, in my case "macbook")

    2. press cmd+shift+dot (will reveal hidden files)

    3. go the .npm-global/bin folder and copy its path (Finder menu -> View -> Show Path Bar, right click on the bin folder in the path bar -> "Copy 'bin' as Pathname")

    4. open Terminal (by default the home folder) and go nano ~/.bash_profile

    5. at the top of the file add export PATH="<cmd+v>:$PATH" (will look similar to this: export PATH="/Users/macbook/.npm-global/bin:$PATH")

    6. save .bash_profile changes and restart Terminal, firebase command should work now

    0 讨论(0)
  • 2020-11-29 01:33

    Below command works for me on terminal

    curl -sL firebase.tools | upgrade=true bash
    

    This command install firebase tool for me

    0 讨论(0)
  • 2020-11-29 01:33

    After installing:
    $ npm install -g firebase-tools
    $ firebase init
    -bash: firebase: command not found
    "If you are getting the above output then follow the below steps:"

    For Windows Users: type this cmd :
    $ npm get prefix
    C:\Users\Jeet\AppData\Roaming\npm [this is the location]

    Now you have to set in enviorenment variable -> (windows+r) -> sysdm.cpl -> Advanced(tab) -> Environment Variables -> under the System Variables -> click on path -> edit -> C:\Users\Jeet\AppData\Roaming\npm [paste] the above location -> apply - ok - ok.

    Restart your bash terminal
    Thanks!!!

    0 讨论(0)
  • 2020-11-29 01:36

    After trying pretty much everything, only one worked for me (I'm on MacOs Catalina):

    Try the following in your terminal:

    curl -sL https://firebase.tools | bash
    This will check the OS of your machine and then install everything else automatically and properly.
    
    The command is from the official Firebase Documentation.
    

    https://stackoverflow.com/a/60474459/1245341

    0 讨论(0)
  • 2020-11-29 01:39

    Installing firebase-tools globally did the trick for me :

    npm install -g firebase-tools
    
    0 讨论(0)
  • 2020-11-29 01:39

    I am on Linux and installing the package with admin privileges resolved the problem:

    sudo npm i -g firebase-tools
    
    0 讨论(0)
提交回复
热议问题