Skip to content

Instantly share code, notes, and snippets.

@RyanCCollins
Last active November 22, 2016 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save RyanCCollins/69443f0ff1f7725d305d to your computer and use it in GitHub Desktop.
Save RyanCCollins/69443f0ff1f7725d305d to your computer and use it in GitHub Desktop.
Standard NodeJS config with NVM

Node configuration.

Update NPM version with the following command

npm update -g npm

Download NVM (Node Version Manager), which will help you to use the correct version of NodeJS

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.1/install.sh | bash

In order to activate the NVM install, run the following command:

. ~/.nvm/nvm.sh

To use a specific NodeJS version, you need to have nvm install the correct version and then you need to tell nvm to right version:

nvm install 4.2.4 && nvm use 4.2.4

If you get permission errors, try this, which will correct permission errors:

sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment