How to Install Node.JS 8 LTS on CentOS 7, Debian 8, and Ubuntu 16?

First of all, Let us see:

What is Node.js?
Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code server-side.  Node.js runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.) and uses JavaScript on the server. Corporate users of Node.js software include GoDaddy, Groupon, IBM, LinkedIn, Microsoft, Netflix, PayPal, Rakuten, SAP, Tuenti, Voxer, Walmart, and Yahoo!. It allows the creation of Web servers and networking tools using JavaScript and a collection of "modules" that handle various core functionality. Modules are provided for file system I/O, networking, binary data, cryptography functions, data streams, and other core functions. Node.js's modules use an API designed to reduce the complexity of writing server applications.

What is NPM?
npm is a package manager for the JavaScript programming language.It consists of a command line client, also called npm, and an online database of public and paid-for private packages called the npm registry. The registry is accessed via the client, and the available packages can be browsed and searched via the npm website. The package manager and the registry are managed by npm, Inc.

Install Node.js and NPM

If you want to install Node.js 8 and NPM 5 you have to install them via RPM/DEB packages.

On Debian 8 and Ubuntu 16

Execute following commands one by one to install Node.JS 8 on Debian and Ubuntu:

apt-get update
apt-get install curl sudo
curl -sL | sudo -E bash -

Now you can install Node.js and NPM easily by typing:

apt-get install nodejs

You can check the version of your Node.js and NPM with:

nodejs -v
npm -v

On CentOS 7

Issue the following commands to install Node.JS and NPM on your CentOS:

curl -sL | bash -
yum install nodejs

It’s done, check the version of Node.js and NPM:

nodejs -v
npm -v

For more information, Please visit  Node.JS official website!

Was this answer helpful? 0 Users Found This Useful (0 Votes)