Skip to content

Instantly share code, notes, and snippets.

@jrnewell
Last active August 29, 2015 14:08
Show Gist options
  • Save jrnewell/c37a425d28d0fc5eb64c to your computer and use it in GitHub Desktop.
Save jrnewell/c37a425d28d0fc5eb64c to your computer and use it in GitHub Desktop.
Fix npm with homebrew on Mac OS X

Fix npm with homebrew on Mac OS X

Adopted from this gist.

rm -rf /usr/local/lib/node_modules
brew uninstall node
brew install node --without-npm
echo prefix=${HOME}/local/npm >> ~/.npmrc  # only do once
mkdir ${HOME}/local/npm
curl -L https://www.npmjs.org/install.sh | sh

Add npm bin directory to path in .bash_profile

export NPM_HOME="$HOME/local/npm"
export PATH="$NPM_HOME/bin:$PATH"

Install global npm modules

npm install -g browserify css2stylus gulp jsfmt node-inspector redis-commander coffee-script goog-webfont-dl html2jade mocha nodemon simple-http-share coffeelint grunt-cli js2coffee node-gyp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment