Switch between Node Versions with NVM

Node Version Manager - Simple bash script to manage multiple active node.js versions

# Use Homebrew to install NVM
brew install nvm

# Create a directory
mkdir ~/.nvm

# Setup config
vim ~/.bashrc
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
source ~/.bashrc

# Make sure nvm has been installed correctly
nvm --version

# Install a different node version
nvm install 8.10

# Double check if node has been installed
nvm list
node -v

# To go back to the original version of node
nvm use node

# To go back to the new version of node
nvm use node 8.10

Resource

https://github.com/creationix/nvm

GitHubGitHubLinkedin