2

I want to use Grunt on websites we have hosted on our WHM dedicated server.

It is running CENTOS 5.10 x86_64 standard with WHM 11.42.1 (build 21).

It is critical that things do not break, as we have over 20 domains running websites on this single server.

I tried to build Node.js from source but it requires Python 2.6+, and we only have Python 2.4 installed. I read somewhere about installing Python 2.6 alongside 2.4 with alternative install but I don't know how to do this.

I found this question that has a shell script that installs it for you, and Node.js did install, however it created a symlink in the folder I ran it from (bad) and also did not install npm for me.

I am quite savvy but not an expert in Linux, especially CentOS, and cannot fathom how to get Node.js and npm to work on CentOS 5.10.

1

Installing a second Python intepreter, with a different minor (or major) version number will not interfere with the 2.4 that you have installed at all.

What you should do at the end of the compile/install process is running:

sudo make altinstall

instead of

sudo make install

as described in the Building Python on Linux docs.

So just download the latest (2.7.7) sources, extract the tar file, configure and make.

You might need to install some development versions of libraries, watch the configure output for potential missing libraries.

Your 2.4 python will still be accessed using python. For the newer version you have to use python2.7 or at the top of any scripts that should use this version of Python:

#!/usr/bin/env python2.7

none of which will interfere with the normal operation of the system relying on 2.4 (and any libraries specifically installed for that version).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.