Created
October 27, 2014 23:52
-
-
Save newshorts/a3193b9ce6cfcb7738ac to your computer and use it in GitHub Desktop.
Run NPM without sudo, installed on mac with brew
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# using Homebrew | |
# Note: `brew install npm` has problems, as of 2010-12-30. | |
# hopefully it will eventually be good and happy. | |
# As of [email protected], however, this is an option | |
PREFIX=$(brew --prefix) | |
# take ownership | |
# this will also let homebrew work without using sudo | |
# please don't do this if you don't know what it does! | |
sudo mkdir -p $PREFIX/{share/man,bin,lib/node,include/node} | |
sudo chown -R $USER $PREFIX/{share/man,bin,lib/node,lib/node_modules,include/node} | |
brew install node | |
# now install npm | |
# prefix will default to $(brew --prefix) | |
curl https://www.npmjs.org/install.sh | sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment