Skip to content

Instantly share code, notes, and snippets.

@lambrospetrou
Last active September 25, 2017 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lambrospetrou/db6a572a33a7aa7d023d6981bc733fc8 to your computer and use it in GitHub Desktop.
Save lambrospetrou/db6a572a33a7aa7d023d6981bc733fc8 to your computer and use it in GitHub Desktop.

Install n

git clone https://github.com/tj/n.git
cd n

# install it to a home folder instead of /usr/local
PREFIX=$HOME/local make install

Update the paths

vim ~/.zshrc # or ~/.bashrc or whatever you use

export NPM_CONFIG_PREFIX="$HOME/local" # npm config get prefix # https://docs.npmjs.com/getting-started/fixing-npm-permissions
export N_PREFIX="$NPM_CONFIG_PREFIX" # for n versions
export PATH="$PATH:$NPM_CONFIG_PREFIX/bin"

Install node/npm

n stable

Now you have the latest stable version of node in $N_PREFIX/bin/node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment