How To Install Nodejs Into Ubuntu, Debian, Fedora, CentOS, RedHat
Install Using Yum Package Manager
We can use
yum package manager in order to install Nodejs. We will run following command in order to install for Fedora, CentOS, RedHat .
$ yum install nodejs
Install 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 From Binaries
If we need up to date binaries about Nodejs we can download from official site. There is two version 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 the long time and will not create compatibility problems.
8.1.3 version will be change during time. This version will have the latest features but it is not stable for production use.
Simply download from following link.
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 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.