this question has answer here:
i have been having trouble installing firebase command line tools. following guide at: https://www.firebase.com/docs/hosting/command-line-tool.html. have run initial command terminal: npm install -g firebase-tools
. once run: firebase init
in root of directory, following error:
-bash: firebase: command not found
i have looked @ guides how manually modify bash profile, can not figure out how so... shouldn't bash .bash_profile automatically modified when run global command?? appreciated. need firebase commands work in terminal, , why global command won't register in bash profile?
when run npm install -g firebase
tries install firebase library , associated binaries system-wide location. can determine location running npm prefix -g
. in order firebase
binary available bash session, bin directory inside global npm prefix must on path.
in bash, easy way add directory path modifying .bashrc
file in home directory. appending line add global npm bin directory current path:
path="$(npm prefix -g)/bin:$path"
once have modified path variable either open new terminal session or run export path="$(npm prefix -g)/bin:$path"
change take effect.
if ~/.bashrc
not being sourced on machine, easy fix adding following line ~/.bash_profile
file:
source "$home/.bashrc"
Comments
Post a Comment