Last Updated: February 25, 2016
·
543
· arvindr21

Install global Node modules without sudo

$ echo "My username is: `whoami`" 
$ sudo chown -R `whoami` /usr/local/lib/node_modules
$ [ -e ~/.npm ] && sudo chown -R `whoami` ~/.npm
$ sudo chown -R `whoami` `npm -g bin`

Credits : appgyver