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

Outraged that Firebase hosting is now out of beta. Trying to get started with the firebase-tools package, and I successfully installed it:

npm install -g firebase-tools

Trying to run any tool with

-bash: firebase: command not found

I tried putting the following command in my .bash_profile with no luck

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

Any ideas? Pretty new to the command line.

Thank!

+39
source share
10 answers

@ mklement0 This answer looks good, but I'm worried that it will scare someone who is so new to the command line. So, I am going to make the cherry tree the most suitable fragment of it.

@cienki , , PATH .bash_profile:

npm get prefix
+20

,

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

npm bin bash PATH. :

npm get prefix

- /home/your-username/npm-global.

~/.bashrc ~/.bash_profile ( Mac) :

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

"/bin" npm get prefix.

+23

firebase- :

npm install -g firebase-tools
+13

, npm-global Ubuntu .bashrc:

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

Mac ( , , Mac):

  1. Finder ( , "macbook")

  2. cmd + shift + dot ( )

  3. .npm-global/bin ( "Finder" → "" → " ", "bin" → "" bin " ")

  4. ( ) nano ~/.bash_profile

  5. export PATH="<cmd+v>:$PATH" ( : export PATH="/Users/macbook/.npm-global/bin:$PATH")

  6. .bash_profile , firebase

+2

Mac OS Sierra:

  1. $ sudo npm install -g firebase-tools
  2. Node, $ ps aux | grep node $ ps aux | grep node
  3. - $ npm install -g @google-cloud/functions-emulator
  4. $ firebase --version
+1

node.js. , .

0

, nvm - , nvm, , firebase . , . webstorm, nvm .

nvm list , , nvm use xxx , firebase.

0

Windows 10, Bash
:

  1. npm get prefix// , C:\Users\User\AppData\Roaming\npm
  2. " ", " ".
  3. In the "System Variables" section, find the PATH variable, select it and click "Change." Click "Create" and add the path found using the "npm get prefix" command earlier (this was C: \ Users \ User \ AppData \ Roaming \ npm for me) Then click "OK"
  4. Restart bash

firebase --version// to check the version of Firebase

0
source

Source: https://habr.com/ru/post/1651021/


All Articles