IMPORTANT: If you have previously installed node using HomeBrew, ensure that you uninstall it before you proceed:
brew uninstall --force nodegit clone git://github.com/creationix/nvm.git ~/.nvm
printf "\n\n# NVM\nif [ -s ~/.nvm/nvm.sh ]; then\n\tNVM_DIR=~/.nvm\n\tsource ~/.nvm/nvm.sh\nfi" >> ~/.bashrc
NVM_DIR=~/.nvm
source ~/.nvm/nvm.shON OSX if you may encouter the error nvm not found,
open ~/.bash_profileand add this:
source ~/.bashrcnvm --versionnvm install 5.7.0
nvm install 5.5.0
nvm install 5.3.0
nvm install 4.2.0
nvm install 0.12nvm install node --reinstall-packages-from=nodenvm use 0.12nvm alias default v6.11.1nvm lsYou can create a .nvmrc file containing version number in the project root directory (or any parent directory). nvm use, nvm install, nvm exec, nvm run, and nvm which will all respect an .nvmrc file when a version is not supplied.
echo "6.11" > .nvmrc