Skip to content

Instantly share code, notes, and snippets.

@1e1f
Created February 18, 2016 05:11
Show Gist options
  • Save 1e1f/3800a1e4d1ac8ce3b71e to your computer and use it in GitHub Desktop.
Save 1e1f/3800a1e4d1ac8ce3b71e to your computer and use it in GitHub Desktop.
nuke node and do a non-sudo install on mac
sudo rm -rf /usr/local/lib/node_modules sudo rm -rf ~/.npm
brew uninstall node
brew install node --without-npm
mkdir "${HOME}/.npm-packages"
echo NPM_PACKAGES="${HOME}/.npm-packages" >> ${HOME}/.bashrc
echo prefix=${HOME}/.npm-packages >> ${HOME}/.npmrc
curl -L https://www.npmjs.org/install.sh | sh
echo NODE_PATH=\"\$NPM_PACKAGES/lib/node_modules:\$NODE_PATH\" >> ${HOME}/.bashrc
echo PATH=\"\$NPM_PACKAGES/bin:\$PATH\" >> ${HOME}/.bashrc
echo source "~/.bashrc" >> ${HOME}/.bash_profile
source ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment