Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase command not found days after having already successfully used it

I am trying to use the 'firebase' command from my Mac terminal to deploy firebase cloud functions using 'firebase deploy --only functions'. I just used this command a week or two ago when I updated my firebase-functions and firebase-tools to version 3.18.4 but now everytime I try to use the 'firebase' keyword to run a command it says -bash: firebase: command not found. When I run npm -g list I see that I have firebase, firebase-tools and more in that list.

I've tried running 'npm install -g firebase-tools` but it still doesn't work. Also I tried what is recommended in this question

but still not working. Any advice would be great, thanks

like image 757
MikeG Avatar asked Jan 29 '23 03:01

MikeG


1 Answers

First I ran npm get prefix which should output something like /Users/username/.npm-packages. Then I had to add the following to my $PATH variable

export PATH="/Users/username/.npm-packages/bin:$PATH" Note the extra /bin (after the result of npm get prefix)

And I also added export PATH="/usr/local/share/npm/bin:/usr/local/bin:/usr/local/sbin:~/bin:$PATH$

Then you must activate the changes to your bash_profile by running source ~/.bash_profile

Once I did this the firebase command is again globally recognized

like image 153
MikeG Avatar answered Feb 05 '23 15:02

MikeG