6

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.

KENdi
  • 7,576
  • 2
  • 16
  • 31
mat
  • 2,412
  • 5
  • 31
  • 69

1 Answers1

5

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.

aofdev
  • 1,772
  • 1
  • 15
  • 29
  • Thank you for your advise, unfortunately none of these worked, the same error popped up. I ended up by completely reinstalling Ubuntu and it works fine now. Sorry for not answering sooner. – mat Aug 25 '17 at 12:17
  • Welcome but No no problem – aofdev Aug 26 '17 at 06:03