Last active
August 29, 2015 14:22
-
-
Save mpalpha/42cefca0f63a14d76ed4 to your computer and use it in GitHub Desktop.
How to use npm global without sudo on OSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Taken from http://www.johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/ | |
in terminal: | |
(if you already have homebrew installed skip to step 2) | |
1) ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
2) brew install node --without-npm | |
3) mkdir "${HOME}/.npm-packages" | |
4) echo NPM_PACKAGES="${HOME}/.npm-packages" >> ${HOME}/.bashrc | |
5) echo prefix=${HOME}/.npm-packages >> ${HOME}/.npmrc | |
6) curl -L https://www.npmjs.org/install.sh | sh | |
7) echo NODE_PATH=\"\$NPM_PACKAGES/lib/node_modules:\$NODE_PATH\" >> ${HOME}/.bashrc | |
8) echo PATH=\"\$NPM_PACKAGES/bin:\$PATH\" >> ${HOME}/.bashrc | |
9) echo source "~/.bashrc" >> ${HOME}/.bash_profile | |
10) source ~/.bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment