|
|
|
|
|
by reedlaw
4763 days ago
|
|
As of version 0.3, it is recommended to run npm as root.
This allows npm to change the user identifier to the nobody
user prior to running any package build or test commands. [1]
npm modules that are used from the command line are often installed with the -g, or global switch so they can be used anywhere. Yeoman [2], for example, is installed to /usr/lib/node_modules/yo/bin/yo and owned by nobody:users on my system. While it's reassuring that these files are chowned to nobody, I confess I don't understand npm enough to tell if running it as sudo will not give modules root access in other ways to my machine.1. https://npmjs.org/doc/README.html 2. http://yeoman.io/ |
|
I've worked with node for a couple years. I've used npm hundreds of times, and I can count on one hand the number of times I've used it in combination with sudo (and all but one were a mistake).
Every time I've used npm with sudo I've received a big warning in red to not do that.