nvm

Node version manager.

Installation

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/HEAD/install.sh | bash
source ~/.bashrc

Update

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/HEAD/install.sh | bash

Usage

<node-version> can be one of the following:

nvm install <node-version>       # Install node
nvm use <node-version>           # Select <node-version> for the current shell
nvm alias default <node-version> # Set <node-version> as the default
nvm ls                           # List installed node versions
nvm ls-remote                    # List available node versions
nvm run node --version           # Run 'node --version'
nvm exec node --version          # Run 'node --version' in a subshell