How to install Node js on Ubuntu 19.04

- Advertisment -
- Advertisement -

Node.js on Ubuntu gives a way to write server-side scripting. It is an open source Javascript cross-platform that executes the Javascript outside the browsers. It uses an NPM package manager to fetch different packages and modules for function extensions of the app developed on Node.js. To install Node.js and NPM on latest Ubuntu 19.04, we don’t need to add any kind  PPA (personal package manager), however, there is an official PPA for Node.js that we can use to install latest versions of Nodejs & NPM on Ubuntu such as 19.04, 18.04 LTS, 16.04 LTS (Trusty Tahr) and 14.04 LTS (Xenial Xerus) Linux servers.

As I said it is cross-platform so we can install it on MacOS and Windows too. For NPM & Node.js Windows installation, see tutorial: Install npm and node.js packages on Windows 10/8/7

Install NPM & Node js on Ubuntu 19.04

Step 1: Offical PPA repository for Node.js

Open the command terminal on Ubuntu Linux and add the official repository for downloading and installing the NPM and Node.js. The Long term stable release of Node.js is 10.15.3 LTS and a current stable release is 11.14.0. By default, the user will get the long term stable version 10.15.3 on Ubuntu 19.04, however, we can install the current version using Node.js PPA.

For long term version, we don’t need to add the repo, just type the commands:

sudo apt-get install nodejs
Sudo apt-get install npm

Note: Without adding latest PPA manually, the user will get Node.js LTS 10.x version from Ubuntu 19.04 repo. So to get a current 11.X release, add the below official repo.

For latest Node.js version 11.x use this PPA:

sudo apt install curl
curl -sL | sudo -E bash -

For 10.X version Node.js use this repo.

sudo apt install curl
curl -sL | sudo -E bash -

Note: As we are using 11.x repo on Ubuntu 19.04, here.

Step 2: Update your system.

After adding the Node.js Repo run the system update command:

sudo apt-get update

Step 3: Command to install the Node.js on Ubuntu 19.04

Note: Without PPA we have to install Node and NPM using two different commands, however, those are using the PPA will get both Nodejs and NPM using single below command:

sudo apt-get install nodejs


Step 4 Install NPM on Ubuntu 190.4 via command

After installing the Node.js, use this command to set up the NPM package manager on Ubuntu 19.04

sudo apt-get install npm

Step 5: Check the installed Node and NPM version on Ubuntu

Versions on Ubuntu 19.04 without using PPA- LTS versions

To check the Node version on Ubuntu, the command is:

node --version

To check the NPM version, the command is:

npm -v 

check npm and node versions

After using the Latest Node.js PPA repo, the latest version–

latest version of NPM and Node on Ubutnu

Step 7: Command to upgrade NVM and Node (optional)

Note: If you are using the PPA, simply run sudo apt update

First, update npm,

sudo npm update
npm install -g npm@next

Then update node to the next version,

npm install -g node@next  
npm install -g node@latest

Step 6: Command to select previous version npm on Ubuntu 19.04 (optional)

Note: Run these commands, if you know what are you doing otherwise it could mess your NPm setup.

Command to see the older available version on Ubuntu

npm view npm versions --json

Command to select the previous NPM version

npm i -g npm@version

For example, I want to select the older 5.8.0 version then the command will be:

npm i -g npm@5.8.0


sudo npm cache clean -f
sudo npm install -g n
sudo n 5.8.0

 Step 7: Let’s install something using NPM (options step):

For example, we want to install Angular CLI using NPM then the commands will like this:

For locally:

npm install @angular/cli

Fo Globally: -g syntax refers to the global

npm install -g @angular/cli

Step 8: Uninstall node js ubuntu

The command to uninstall node.js on Ubuntu is:

To uninstall Nodejs

sudo apt-get remove nodejs

To uninstall NPM

sudo apt-get remove npm

Completely remove NPM related entries:

sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*



Other Tutorials:

H2S Media Team
H2S is a group of tech enthusiasts those are passionate about latest technology developments. They always like to solve own technical problems and share the same solution with others through this Website.


  1. Ubuntu *already has* nodejs. You don’t need to install an ‘official repository’ for it – you just apt-get install nodejs. Done.

    • Yes, indeed but it will install the LTS version only. For beta or current version either install the PPA or need to upgrade the LTS version after its installation.

  2. Thanks for the tidy collection and layout.

    Should the first instruction read “sudo apt install nodejs”? – since the package is named “nodejs” rather than “Node.js”.


Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Latest Posts

Zebronics launches ZEB-Juke Bar 9000 sound bar with Dolby Digital Plus

Zebronics that has been working in the audio industry for a very long time recently has launched its new...

List of Best SQL Server Monitoring Tools with free trial in 2020

Monitoring database server not only for SQL but all kind of database systems is really a crucial task and need...

How to run Chrome extensions on Microsoft Edge Chromium browser

It is long since we know about Microsoft Edge, which is Microsoft's endeavour to dominate the market of browsers....

How to get dark mode on WhatsApp to keep eyes stress free

WhatsApp keeps adding new features to the app, and most features turn out to be useful for us, except...
- Advertisement -

73% of software developers willing to invest Rs 10-20k per year for upskilling

The rapid development in the technology area is compelling the firms and developers to gear up their technology skills...

Sony accidentally confirmed a massive News leak on PS5

The PlayStation 5 launch is just around the corner. Also, the rumours are about an upcoming meeting of Sony...

- Advertisment -
- Advertisement -

You might also likeRELATED
Recommended to you