Skip to content

Instantly share code, notes, and snippets.

@kmccarth
Last active October 31, 2017 17:31
Show Gist options
  • Save kmccarth/fd758e55bc60dec4a5356db9c1392d0d to your computer and use it in GitHub Desktop.
Save kmccarth/fd758e55bc60dec4a5356db9c1392d0d to your computer and use it in GitHub Desktop.
Install
$ brew update;
$ brew install nvm;
$ mkdir ~/.nvm;
Configure
This will make the "nvm" command available in your terminal
$ atom ~/.bash_profile;
Add these lines right below your last "export" statement if one is already present
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
Save the file in atom, then back in the terminal...
$ source ~/.bash_profile;
$ echo $NVM_DIR;
Using
Show which node versions are currently in use and which are available
$ nvm ls;
Install an older version of node
$ nvm install 4.4.7;
Use a different node version
$ nvm use 4.4.7;
Alias 4.4.7 for va-web-2; "nvm alias <name> <version>"
$ nvm alias va-web-2 4.4.7;
$ nvm use va-web-2;
Helpful bash_profile command
function vaweb2_gulp_serve
{
cd ~/ventureapp/web;
nvm use 4.4.7;
npm install;
bower install;
gulp serve;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment