How to Install Node Version Manager on Ubuntu 16.04

Reading Time: 2 minutes

The Node Version Manager (NVM) is a command-line utility used to manage and switch between multiple active versions of Node.js on a single system. Whether you’re an admin or a developer, being able to change the javascript runtime environment on your system simplifies testing applications across different versions.

How to Install Node Version Manager on Ubuntu 16.04

 Step 1: Prerequisites

First, I will begin this process by logging into the server as the root user. Next, as best-practice dictates, we will ensure that all packages are up to date:

[root@host ~]# apt-get update -y

After this, we will ensure we have a C++ Compiler to work with, by installing the build-essential package:

[root@host ~]# apt-get install build-essential libssl-dev -y

Step 2: Install NVM

Run The Node Version Manager Installation Script

After getting our C++ Compiler installed, running this curl command will pull down and run the NVM installation script:

[root@host ~]# curl -o- | bash

Always trust and verify the commands you are installing from an external bash source. Running a bash command from a malicious external source (especially as root) can cause undesirable effects up to and including data loss!

At the time of this publication, NVM v0.34.0 was the latest version available.
You can check for the newest release of NVM. This link will always take you to the most recent release version of NVM. After this, you will want to adjust the above command to point to the newest version of NVM.

Once the installation process is complete, you should see output that looks something like this:

Close and then re-open your terminal to start using nvm

Instead of closing and re-opening your terminal, run the following command in the same terminal session:

[root@host ~]# source ~/.profile

or, you can log out and log back into your server if you wish.

Step 3: Verify the Installation

The last thing you will want to do is verify that NVM was installed and is working correctly. To accomplish this, run the following command:

[root@host ~]# nvm --version

The output will show:

[root@host ~]# 0.34.0

which is the latest version of NVM

For more information on how to use nvm, you can use the following command to get started:

[root@host ~]# nvm help

or visit NVM's GitHub page for more info.

How can we help?

Our Support Teams are standing by with knowledgeable admins with an intimate knowledge of these and other web hosting technologies, especially those discussed in this article. If you are uncomfortable walking through the steps outlined above, feel free to contact us. If you’re running on one of our fully managed servers, we will be happy to assist, directly implementing the changes in this article that you require.

Avatar for Justin Palmer

About the Author: Justin Palmer

Justin Palmer is a professional application developer with Liquid Web

Latest Articles

How to use kill commands in Linux

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change the root password in WebHost Manager (WHM)

Read Article