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