How to install Node.js on CentOS
Installing Node.js on CentOS is slightly different from installing on Ubuntu Linux. The main differences being in the name of the package manager and the package names.
The package manager of CentOS is called Yum. Make sure a Cxx compiler and OpenSSL development packages are installed, else you will be stopped by these errors.
wscript:261: error: could not configure a cxx compiler!
wscript:372: error: Could not autodetect OpenSSL support. Make sure OpenSSL development packages are installed. Use configure --without-ssl to disable this message.
Important note: the
libssl-dev package of Ubuntu is known as
openssl-devel in CentOS.
The outlines of the installation process is shown below:
$ sudo yum install gcc-c++
$ sudo yum install openssl-devel
$ sudo make install
'install' finished successfully (0.412s)
That's it! Once you see the "finished successfully" message, confirm Node is working on the box this way:
$ node -v
I hope that helped you with your Node.js installation on CentOS Linux. Personally I find CentOS a little difficult to deal with compared to Ubuntu. But hey, sometimes you have no choice over what you want. Any questions, queries; ping me in the comments.