Arguably the most basic and repeated task for any Node developer is installing Node.js on a server. So it makes sense to find the quickest way to do it. The solution is node version manager or nvm. NVM makes it easy to install any version of node or multiple versions of node on the same server.

Installing NVM

Installing NVM is easy. Just enter the following command into your terminal.

curl -o- | bash

You will see a line telling you to close and reopen your terminal. This is not necessary you can instead use this command.

source ~/.profile

Run the following command to get a list all available versions of node.js.

nvm ls-remote

Installing Node.js

Run this command to install the latest stable version of node.

nvm install stable

Check the installed version of node with this command.

node -v

Optional steps

You have now installed node.js with nvm. If you would like to use a different version of node.js can specify the version with.

node use v10.9.0

Want me to do this for you?

I'd love to help you with your project.

view services