Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compiling and Installing Node v0.8.4 on CentOS 5.x

Compiling/Installing Node 0.8.4 (and Python 2.6, required by Node) on CentOS 5

Update system packages -- will migrate system forward to CentOS 5.8. (Optional?)

$ sudo yum update

Install the EPEL Repo:

$ sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

Install the newly available python26 Package from EPEL Repo:

$ sudo yum install python26

Set python26 to be the default in your shell when you simply execute 'python' This is critical to being able to build node modules with native extensions

$ mkdir -p $HOME/bin
$ ln -s /usr/bin/python26 $HOME/bin/python
$ echo 'export PATH=$HOME/bin:$PATH' >> ~/.bashrc

Activate modified .bashrc for current terminal session

$ source ~/.bashrc

Verify Python 2.6 is ready to go. (Should print "Python 2.6.8")

$ python -V

Install Development Toolchain

$ sudo yum groupinstall "Development Tools"

Switch to home directory:

$ cd ~

Download Node 0.8.4 source tarball:

$ wget http://nodejs.org/dist/v0.8.4/node-v0.8.4.tar.gz

Untar:

$ tar -xzf node-v0.8.4.tar.gz

Switch to node directory:

$ cd node-v0.8.4

Run configure script with newly installed python binary

$ ./configure

Compile Node

$ make -j5

Install Node

$ sudo make install

Verify installation (should print "v0.8.4")

$ node --version
@andypotanin

This comment has been minimized.

andypotanin commented Oct 6, 2012

Thank you! Worked flawlessly on 6.3 as well.

@h2rd

This comment has been minimized.

h2rd commented Mar 28, 2013

Thank you! Your config way are the best for me

@methakon

This comment has been minimized.

methakon commented Jun 5, 2013

worked finely with 5.9

@olliemaitland

This comment has been minimized.

olliemaitland commented Jul 20, 2013

Worked great for 5.9, nice one

@danbruder

This comment has been minimized.

danbruder commented Sep 20, 2013

Awesome! Thanks!

@raknjak

This comment has been minimized.

raknjak commented Sep 27, 2013

Confirmed working on 5.9 for me, too. Thanks so much.

@Priyatham51

This comment has been minimized.

Priyatham51 commented Oct 22, 2013

Thank you so much!!!.

@rsbgm

This comment has been minimized.

rsbgm commented Nov 28, 2013

Awesomeness! Woohoo! Thanks!

@jonathanbak

This comment has been minimized.

jonathanbak commented Dec 20, 2013

Thanks~ Good!

@soap

This comment has been minimized.

soap commented Dec 26, 2013

Great it works fine on my CentOS 5.10 box. Thanks.

@kazu69

This comment has been minimized.

kazu69 commented Jan 28, 2014

Thanks!!!

@onewaterdrop

This comment has been minimized.

onewaterdrop commented Mar 19, 2014

flawless on centOS 5.10 final. Thanks.

@xocru

This comment has been minimized.

xocru commented Aug 21, 2014

Working on centOS 5.10 final. Thanks!
Just one comment, I have had to install bz2 library and recompile python to be able to compile node.

-- Install bz2 library (
sudo yum -y install bzip2 bzip2-devel bzip2-libs

-- Recompile python from sources
cd /path/to/python_package
./configure
make
sudo make install

-- Compile and install node again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment