Node: MacOS

Installing and working with Node, npm, nvm on MacOS

Install npm packages globally without sudo on macOS

These instructions work for Linux too.

https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md

Should I install npm or nvm?

Most node tutorials suggest installing node and then using the tool npm.

It’s probably a better idea to work with nvm if you are using your own computer, as that will allow you to maintain separate node environments for different projects.

This StackOverflow answer explains more: http://stackoverflow.com/questions/16151018/npm-throws-error-without-sudo

Installing nvm

See: https://github.com/creationix/nvm#install-script

npm install wants root / sudo. What should I do?

See this StackOverflow answer: http://stackoverflow.com/questions/16151018/npm-throws-error-without-sudo