Installing Node.js on CentOS, Red Hat, or Fedora requires enabling the EPEL repository. The default repositories do not include Node.js, making this step necessary. Once the repository is enabled, you can install a stable version of Node.js.
Node.js is a popular runtime that allows you to run JavaScript outside of a browser. This is essential for server-side scripting and various development tasks. Installing Node.js also includes npm, which is the package manager for JavaScript.
For those who need the latest version, installing from the NodeSource repository is an option. This method provides access to the most recent features and updates that might not be available in the EPEL repository.
$ sudo yum install --assumeyes epel-release
$ sudo yum install --assumeyes nodejs ########################## ============================================================================================== Package Arch Version Repository Size ============================================================================================== Installing: nodejs x86_64 1:6.14.3-1.el7 epel 4.7 M Installing for dependencies: http-parser x86_64 2.7.1-5.el7_4 base 28 k libuv x86_64 1:1.22.0-1.el7 epel 127 k npm x86_64 1:3.10.10-1.6.14.3.1.el7 epel 2.5 M Transaction Summary ============================================================================================== Install 1 Package (+3 Dependent packages) ##########################
$ node -v v6.14.3
$ npm -v 3.10.10