I am Hack Sparrow
Captain of the Internets.

Install Node.js on CentOS

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
$ ./configure
$ make
$ 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.

11 Responses to “Install Node.js on CentOS”

  1. Andrea Salicetti says:

    Thank you, this was useful to me!

  2. Vadim says:

    Hi Hack.

    Do you have any experience in installing NPM (node package manager) on CentOS? I wasn’t able to install it, or to be more exact, wasn’t able to use it after installing. I think, the main problem is file name which is “nodejs” on CentOS rather then “node” on others. Any suggestions?

    Thank you,


  3. Captain says:

    Get the latest source code of Node http://nodejs.org/dist/v0.6.6/node-v0.6.6.tar.gz NPM now comes built-in by default. Install Node, and you have NPM installed already.

  4. Mike says:

    thanks that was very helpful!

  5. Nikhil Baliga says:

    Thanks a lot. Very helpful!

  6. Doug says:

    Thanks for this article – it was the only tutorial I found with the yum install gcc-c++ line, which is what I needed for the install. Kudos!

  7. roussin51 says:

    Thanks!! It worked on fedora too!

  8. Captain says:


  9. Eugenio says:

    Thanks!! worked on Centos 5.7

  10. Megajoe17 says:

    thanks, it’s was usefull!

Make a Comment