indexzero
7/17/2015 - 11:43 PM

Make npm work good on linux and stuff.

Make npm work good on linux and stuff.

#
# 1. Set your npm prefix to ~/.node_modules
# nb. Windows users here be dragons.
#
npm c set prefix $HOME/.node_modules
mkdir $HOME/.node_modules

#
# 2. Update your path to give the bin location of 
# the new prefix directory highest precedence
#
# 2(a). Open your ~/.profile (or ~/.bash_profile depending 
# on your setup) with your favorite editor. For simplicity
# we'll use vim below
#
vim ~/.bash_profile

#
# 2(b). Add near the top of your profile file. If you have no
# idea what you're doing here just make sure it's above other
# "export PATH" statements
#
export PATH=$HOME/.node_modules/bin:$PATH