Snippets

Dr Wolf npm -g without sudo

Created by Andrea Agili last modified
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  

Comments (1)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.