Node JS has been gaining more popularity as the server-side runtime environment of choice these recent years. The asynchronous event-driven feature built into Node JS can be considered a killer feature that may flatter a system architect planning to build a high-performing server-side component serving HTTP webservice to the clients.
Node JS is cross-platform. The executable can run on major OSes that include Windows, GNU Linux, and Mac OS. Having a wide OS support further accelerates Node JS adoption within the server-side technology stack.
More posts about Node JS and sample applications are forthcoming. As a starter, in this post we will revisit with the basic, Node JS installation. More precisely, we will focus Node JS 8 installation on CentOS 7. By installing Node JS, we will also install Node Package Manager (NPM) that can be later used to download Node JS modules.
Node JS installation process is very streamlined. As outlined below, the installation will be completed in five simple steps.
1. Install epel-release package.
Note: Extra Packages for Enterprise Linux (EPEL) is a Fedora Special Interest Group that creates, maintains and manages additional packages for Enterprise Linux. In other words, EPEL repository contains the Fedora releases of additional packages that can be used by Enterprise Linux distros, including CentOS.
$ sudo yum install epel-release
2. Download Node JS v8
$ sudo curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
3. Install build tools
$ sudo yum install gcc-c++ make
4. Install NodeJS via yum
$ sudo yum install -y nodejs
5. Verify node and npm version by executing the following commands
$ node -v
$ npm -v
We should be setup and good to go now. But if you have a special issue with your Node JS installation, simply describe it in the comment section to seek for some help.