Reputation: 2617
I am trying to (re)install Firebase, however, when I run sudo npm install -g firebase-tools
the following error shows up:
I have no idea what is wrong, it used to work well a few month ago.
Upvotes: 6
Views: 594
Reputation: 1812
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.
Upvotes: 5