Nodejs is a platform built on Google Chrome Javascript runtime. Nodejs has different usage where Javascript traditionally used in client-side applications. Nodejs can be used in both client and server-side applications. In this tutorial, we will look at how to install Nodejs into Linux distributions like Ubuntu, Debian, Fedora, CentOS, RedHat.
Install Nodejs Using Yum Package Manager
We can use yum
package manager in order to install Nodejs. We will run the following command in order to install for Fedora, CentOS, RedHat.
$ yum install nodejs

Install Nodejs Using Apt Package Manager
We can use apt
or apt-get
package manager in order to install Nodejs. This will work Ubuntu and Debian based distributions too.
$ apt install nodejs
Install Nodejs From Binaries
If we need up to date binaries about Nodejs we can download from the official site. There are two versions to download Nodejs. Lower version is recommended for most of the users which is currently 6.11.0 LTS. LTS means long term support which means this version will be supported for a long time and will not create compatibility problems. 8.1.3 version will change during time. This version will have the latest features but it is not stable for production use.

Download Nodejs Binary
Simply download from following link.
https://nodejs.org/en/download/
Extract Nodejs Binary
and then extract downloaded file with the xz
command like below.
$ tar xvf node-v6.11.0-linux-x64.tar.xz
Update Path Environment Variable
In order to access node
binary from the shell we need to add the bin
folder of the extracted folder to the PATH
variable like below.
$ export PATH=$PATH:"/home/ismail/node-v6.11.0-linux-x64/bin"
We can test the Nodejs just typing following command.
$ node
1 thought on “How To Install Nodejs Into Linux (Ubuntu, Debian, Fedora, CentOS, RedHat)?”