Skip to content

Instantly share code, notes, and snippets.

@hubwub
Created December 23, 2014 22:33
Show Gist options
  • Save hubwub/dc64b4c1f66afbc1307f to your computer and use it in GitHub Desktop.
Save hubwub/dc64b4c1f66afbc1307f to your computer and use it in GitHub Desktop.
# using Homebrew
# Note: `brew install npm` has problems, as of 2010-12-30.
# hopefully it will eventually be good and happy.
# As of npm@0.2.13, 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 -L 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