mkdir ~/.npm-global

npm config set prefix '~/.npm-global'

Add to shell script:

export PATH=~/.npm-global/bin:$PATH