Centos: Quick’n’easy howto install node.js

Unfortunately I could not find proper node.js RPM available, so I had to resort to building it from source. Completely against RH ideology but what else you can do?

For reason of personal preference node.js developers resorted to python as the configuration generator (I guess they are so innovative and ahead of their time that autoconf/automake just isn’t going to cut it for them – knowing/using this ancient technology is totally below them). But I digress, the problem is that they also insisting on python 2.6 which is not Centos 5 stock version.
So, let’s begin:

  1. You will need to install EPEL repo and install python26 RPM out of it.
  2. Get latest node.js from the developers node.js download and unpack it at your $SRC directory (mine is usually at /usr/local/src).
  3. Next step would be to use python26 to generate node.js build configs and install it under /usr prefix as other common daemons

    It’s ready now.
  4. At some point in the future you might need node.js startup script to serve your js content. Here is the one I have:

    You will have to adjust ROOT_DIR and node.js user to accommodate your situation and register the service with chkconfig.

As of nodejs release 0.8.8 usage of python26 on ./configure script is not enough anymore. In order to properly install you have to create PYTHON environment variable and point it to python26.
So instead of

It will have to be

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">