1# View all global packages
2npm list -g --depth=0
3
4# Tell npm to install packages in the home directory instead of root
5npm config set prefix ~/npm
6
7# Create an executable file to fix path (mac)
8vi ~/.bash_profile
9
10# add these lines:
11export PATH="$PATH:$HOME/npm/bin"
12export NODE_PATH="$NODE_PATH:$HOME/npm/lib/node_modules"
13
14# Run the file to export
15. ~/.bash_profile
16
17# take ownership of everything in your ~/.npm directory (must be run with sudo):
18sudo chown -R $USER:`id -g -n $USER` ~/.npm
19
20# Ready to go!
21npm install -g gastby-cliCreated on 1/31/2019