Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when trying to install firebase with NPM

I am trying to (re)install Firebase, however, when I run sudo npm install -g firebase-tools the following error shows up:

enter image description here

I have no idea what is wrong, it used to work well a few month ago.

like image 390
mat Avatar asked Aug 17 '17 11:08

mat


1 Answers

You try running

npm cache clean

and then trying to install again.

If the error is not lost try below

Have you tried installing homebridge with the --unsafe-perm option?

sudo npm install -g --unsafe-perm homebridge

If npm detects it is running as root it drops to a non-privileged user which then doesn't have permissions to write to /root/.node-gyp. The --unsafe-perm option stops it from changing user.

nvm doesn't have this problem when not using sudo because it stores everything under the current users' home directory.

like image 135
aofdev Avatar answered Sep 21 '22 10:09

aofdev