Node Version Manager

Install Node Version Manager and Node

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
$ nvm install node

What is NVM?

Node Version Manager is a tool that allows programmers to seamlessly switch between different versions of Node based on package.json files. You can install each version with a single command and set a default via the command line interface.

To install a specific version of node:

$ nvm install 6.14.4

You can list available versions using ls-remote:

nvm ls-remote

In a project directory with a package.json file just use the installed version.

nvm use && npm install