2 ms·
Running npm as root is bad, either install the npm package from your distribution (apt, pacman...) or, to use `npm install -g` edit `.npmrc` add `prefix=/home/<
by kuon 9y ago
Running npm as root is bad, either install the npm package from your distribution (apt, pacman...) or, to use `npm install -g` edit `.npmrc` add `prefix=/home/<me>/.node` in it, and add `~/.node/bin` to your path.
- homulilly 9y agoIt's bad, but at the same time it's hard to blame people doing it too much when it's literally in the npm documentation: https://docs.npmjs.com/troubleshooting/common-errors https://docs.npmjs.com/troubleshooting/common-errors
- kuon 9y agoI am not blaming people, maybe my comment wasn't formulated properly. What I meant is "don't do it, there is an alternative". I think no documentation should ever include sudo in their commands. You should put a note "depending on your environment, some of those commands might require root privileges" or something.