Skip to content

Instantly share code, notes, and snippets.

@cookie-ag
Last active August 20, 2017 03:05
Show Gist options
  • Save cookie-ag/490c4f9db7bc855e4a45dd7be9021c23 to your computer and use it in GitHub Desktop.
Save cookie-ag/490c4f9db7bc855e4a45dd7be9021c23 to your computer and use it in GitHub Desktop.
Using npm without sudo (OSX/Linux)
# Goto home dir
- cd "${HOME}"
# Check where npm is installed
- npm config get prefix (The output is generally "/usr/local"
# Change the permissions
- sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment