create ~/.npmrc
:
prefix=/home/cbrake/.npm-global
in .bash_profile
:
export PATH=~/.npm-global/bin:$PATH
Then, when you run npm install -g
, packages are installed in your home dir instead of asking you for the root password to install in a system directory.