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-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.
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.