How to Install NVM (Node Version Manager) for Node.js on Ubuntu 16.04 LTS

Node Version Manager, also known as NVM is used to control and manage multiple active versions of Node.js in one system. It is a command line utility and a bash script that allows programmers to shift between different versions of Node.js. They will be able to install any version using a single command and setting defaults using the command line utility.

Note:

  • These installation instructions are specifically for an Ubuntu 16.04 LTS server.
  • I am using a Liquid Web Storm VPS Ubuntu 16.04 LTS 64-bit Core-managed server.
  • I will be logged in as Root.

Step 1: Installing NVM (Node Version Manager) on Ubuntu 16.04 LTS

  1. Install a C++ Compiler
    First, make sure all packages are up to date:apt-get update
  2. The build-essential package (C++ Compiler) should exist on the server, however, we will still include it in our installation process:apt-get install build-essential libss1-dev

Step 2: Install NVM (Node Version Manager)

  1. Using this curl command will start the installation script:curl-o-https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash

    Note:

    At the time of this publication, NVM v0.33.8 was the most recent version available. You should check the GitHub project page for the latest release of NVM, and adjust the above command to include the newest version.

  2. After running the curl command, the output should look similar to the following:Close and reopen your terminal to start using nvm
  3. You can do as the above output suggests or run the following command:source ~/.profile

Step 3: Verify the Installation

Now you can verify that NVM is installed and working properly using the following command:nvm --version

The output will show:0.33.8

Note:

You can always use the help command to get you started on the node.js management:nvm help
Be Sociable, Share!

    Author Bio

    About the Author: Jennifer Walsh

    I am a Managed Applications Technical Support Specialist III at Liquid Web with a background in Information Security and System Administration. My passions are my family, my dogs > Penny and Rose, educating anyone on information security, and my ninja 650.

    Here's 75 % off, Launch a New VPS Today. Find out why 30,000 customers have chosen our Best-in-Class Performance & 24x7 Heroic Support