Install NodeJS on Ubuntu

Written by
Date: 2020-05-19 19:05:00 00:00

How to install NodeJS on Ubuntu

If you want to install NodeJS in a different version than the one that comes with your Ubuntu distribution, you may proceed this way.

First thing, you need to install needed packages.

apt-get install build-essential

Now, choose one of the next lines, depending on the version you need to install.

10.x version

sudo curl -sL https://deb.nodesource.com/setup_10.x | bash -
sudo apt update
sudo apt install nodejs

12.x version

sudo curl -sL https://deb.nodesource.com/setup_12.x | bash -
sudo apt update
sudo apt install nodejs

13. version

sudo curl -sL https://deb.nodesource.com/setup_13.x | bash -
sudo update
sudo apt install nodejs

That is it, you have it installed now.