Use npm -g without password

Written on 03 August 2015

Npm use /usr/lib or /usr/local/bin/, when use npm -g, must use sudo. To use npm without sudo just create new npm global directory

 $ mkdir ./npm-global

Then change locate to new directory

npm config set prefix ~/.npm-global

Add new dir $PATH to .bashrc or .profile


Done !

Reading list :

Read more on nodejs node npm