Skip to content

Instantly share code, notes, and snippets.

@bradbergeron-us
Created June 8, 2015 09:38
Show Gist options
  • Save bradbergeron-us/5dfbd04fe4fcd7d5bcc4 to your computer and use it in GitHub Desktop.
Save bradbergeron-us/5dfbd04fe4fcd7d5bcc4 to your computer and use it in GitHub Desktop.
NPM no more 'sudo'
Copy and paste following commands into terminal
-----------------------------
brew install node --without-npm
mkdir "${HOME}/.npm-packages"
echo NPM_PACKAGES="${HOME}/.npm-packages" >> ${HOME}/.bashrc
echo NPM_PACKAGES="${HOME}/.npm-packages" >> ${HOME}/.zshrc
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 NODE_PATH=\"\$NPM_PACKAGES/lib/node_modules:\$NODE_PATH\" >> ${HOME}/.zshrc
echo PATH=\"\$NPM_PACKAGES/bin:\$PATH\" >> ${HOME}/.bashrc
echo PATH=\"\$NPM_PACKAGES/bin:\$PATH\" >> ${HOME}/.zshrc
echo source "~/.bashrc" >> ${HOME}/.bash_profile
echo source "~/.bashrc" >> ${HOME}/.zprofile
source ~/.bashrc
source ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment