- Open your command-line application.
- Clone the nvm project into a directory in your home folder:
git clone https://github.com/creationix/nvm.git ~/.nvm
- Add the following code to the bottom of your ~/.bashrc or ~/.zshrc file. If you don't know what shell you are running, it is probably bash and you should add the entry to ~/.bashrc:
# Configure NVM export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"
- Save the file and return to your command line:
source ~/.bashrc # (or ~/.zshrc if you're running zshell)
- Confirm your installation by checking the version number of nvm:
> nvm --version0.33.5
- List all of the node versions available ...