-
Notifications
You must be signed in to change notification settings - Fork 147
Description
Most people that use Node.js will have problems if they install Node.js globally, because they would require npm to install libraries globally with sudo. This got 1503 upvotes on StackOverflow. This is the page on how to fix the npm permission issue: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally. This is scary for most newbies, and they will have to go through.
Note that npm recommends to use a version manager as the best way to install Node.js: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm. I agree with them, it's the safest and mo way to install Node.js.
The list of things that creates this kind of permission issues for our users:
- distro-specific packages (deb, rpm, brew, port, ...)
- dmg file for Mac OS X
I've personally fixed 100+ computers with this problem across my life. Fixing this requires some not-so-nice solution like sudo chown -R $(whoami) ~/.npm.
Another technical solution that is not nvm can be found.