Installing latest NodeJS on Ubuntu 18.04 using nvm (Node Version Manager)

377


NVM is a very handy tool to install and manage NodeJS versions on your local computers as well as your Linux servers.
In this post we will show you how install NVM and install latest NodeJS on Ubuntu 18.04

Run the following series of commands to install nvm on Ubuntu 18.04


$ sudo apt-get update
$ sudo apt-get install build-essential libssl-dev
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash

This completes your nvm installation, it adds source string ~/.bashrc file.

IMPORTANT NOTE: You mush close and reopen your terminal to start using nvm

Once you re login, run the following command to install latest NodeJS versions

nvm install 10.13.0

Thats it, now you have successfully installed NodeJS on Ubuntu 18.04, you can run the following commands to verify your installation

$ node -v
v10.13.0

$ npm -v
6.4.1