Skip to content

Instantly share code, notes, and snippets.

@glennblock
Created June 9, 2013 20:07
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save glennblock/5744999 to your computer and use it in GitHub Desktop.
Save glennblock/5744999 to your computer and use it in GitHub Desktop.
Configure npm to not require sudo for local or global modules. Warning this does enable all files in usr/local/bin to run as super user.
user=`whoami`
# if installing node directly
sudo chown -R $user /usr/local/bin
sudo chown -R $user /usr/local/lib/node_modules
# if using nvm
sudo chown -R $user ~/.npm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment