Installing node.js on a CentOS 5.5 server

Ki Kim's picture

If you manage to install binaries and run it, that's much simpler. If you need to compile yourself, then these tips can save you some time.

These are prerequisites to installing node.js. You can skip the ones that are already installed.

1) Install g++

$ yum install sudo gcc-c++

2) Install bzip2-devel (besides bzip2)

$ yum install bzip2-devel

3) Upgrade python to 2.7.3 (from 2.4)
- Node.js requires python 2.6 or 2.7
- If you have 3.0, see https://github.com/joyent/node/wiki/Installation

$ curl -O http://python.org/ftp/python/2.7.3/Python-2.7.3.tgz
$ tar xfz Python-2.7.3.tgz
$ cd Python-2.7.3
$ ./configure
$ make
# You'd need to be either root or a sudoer
$ sudo make install

After these, I was able to compile node.js without an error. Latest version of node.js may be different from the example.

$ curl -O http://nodejs.org/dist/v0.8.14/node-v0.8.14-linux-x64.tar.gz
$ tar -zxf node-v0.8.14.tar.gz
$ cd node-v0.8.14
$ ./configure
$ make
# You'd need to be either root or a sudoer
$ sudo make install
Category: 

Comments

Great! was having trouble with node, I guess I had an old version of Python running.

I literally jumepd out of my chair and danced after reading this!

Please note that when I curled node using given URL: http://nodejs.org/dist/v0.8.14/node-v0.8.14-linux-x64.tar.gz the config file was missing. I used http://nodejs.org/dist/v0.8.11/node-v0.8.11.tar.gz to fix this issue.
Thanks again for you post. It helped me a lot!

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.