Here are the steps to mirror my set-up:
$ cd ~ $ mkdir -p bin $ curl https://raw.githubusercontent.com/davidchambers/dotfiles/master/bin/npm >bin/npm $ chmod +x bin/npm $ echo 'export PATH="$HOME/bin:$PATH"' >>.bashrc $ source .bashrc
Note that the file needn't live at ~/bin/npm; it can live anywhere on your PATH. I keep it in ~/bin so it can live in this repository.