How to install node js on ubuntu 16.04 and 18.04
In this article, We will learn to you how to install and node js on ubuntu 16.04 and 18.04. first, We will know about node js. Nodejs is an open-source framework it used the javascript server and it is run on different os like Windows, Linux, Unix, and Mac, etc.
So, you can follow the below steps to download the node js and install node js on ubuntu.
Installing Using a PPA
First, We need to check which versions are compatible in our system. so, you can go to node js official website and check which version latest and stable. here we will add stable Node Js PPA using below command.
1 2 | $ sudo apt-get install curl $ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - |
Install Nodejs
In this step, we need to install the stable version of node js. so here we will install setup_12.x node js version using the below command.
1 | $ sudo apt-get install nodejs |
Check node js and npm version
Now, After the complete node js installation, we need to know which version install in our system. so we can know the version using the below command.
1 | $ node -v |
Similarly, we can know the version of NPM using the below command.
1 | $ npm -v |
Simple node js application
here, we will create a simple hello world application. so you can follow below Url.