How to Install Latest Node.js on Ubuntu with PPA

Add Node.js PPA

Use Current Release: Node.js 13 is the current Node.js release available.

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


root@vps:~# curl -sL | sudo -E bash -
## Installing the NodeSource Node.js 13.x repo...
## Populating apt-get cache...
+ apt-get update
Hit:1 eoan InRelease
Get:2 eoan-updates InRelease [97.5 kB]

Install Node.js on Ubuntu

Run the following command to install nodejs package

sudo apt-get install nodejs


root@vps:~# sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libpython-stdlib libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib py

Check Node.js Version

Check the version Once the installation is complete

node -v


root@vps:~# node -v

Uninstalling Node.js

If you wish to uninstall Nodejs and npm packages, you can run the command

sudo dpkg -r  nodejs


root@vps:~# sudo dpkg -r  nodejs
(Reading database ... 111143 files and directories currently installed.)
Removing nodejs (13.0.1-1nodesource1) ...
Processing triggers for man-db (2.8.7-3) ...

To verify that nodejs is uninstalled you can run the following command

node -v


root@vps:~# node -v
-bash: /usr/bin/node: No such file or directory