login community faq

I was updating my installed version of node.js this past weekend and ran in to a few problems, turns out due to the node team's decision to switch from the waf build system to gyp, there is now a Python 2.6+ dependency in the configure script.

On some webfaction boxes, the Python version that responds to "python" in env is 2.4, so you'll need to tell it where to look for the right version. The configure script looks for python in /usr/bin/env - here's the easiest way to get things working (worked for me) - people with better knowledge of Linux sysadmin type stuff will no doubt be able to improve this with a better alternative!

I’m going to be writing a new updated guide to setting up node.js on Webfaction shortly, but a quick tip that had me caught up last night while upgrading node to 0.8.1 from 0.4.11 on my Webfaction server:

In the 0.8 branch, node moved away from the waf build system to use gyp. A dependency of gyp is Python 2.6+, so if you just run the configure script on some webfaction boxes, it will fail.

You need to make sure it uses Python 2.6 or 2.7, so do this:

  1. Check your version of Python at /usr/bin/env that responds to “python”:

    /usr/bin/env python -V

If it’s > 2.6, you can skip the rest of this and just install node! If it’s <2.6…

  1. Ensure that your PATH contains /usr/local/bin:

    echo $PATH

  2. If it does, skip to step 3. If it doesn’t, add it:

    export PATH=/usr/local/bin:$PATH

  3. Edit the configure script (not best practice, but quickest way that I’ve found works. Someone with better *nix skills can advise you how to make this available at /usr/bin/env python, negating the need to edit this file…)

    vi ~/PATH_TO_UNPACKED_NODE_TARBALL_FOLDER/configure

  4. On the very first line, change “python” to “python2.7”

  5. Save the file, then run it:

    cd ~/PATH_TO_UNPACKED_NODE_TARBALL_FOLDER/ ./configure --prefix=$HOME make && make install

  6. Check it worked…

    node -v

(Should display the version matching the one you downloaded!)

(X-Posted this on my site: http://davestevens.us/post/26911399072/nodejs-requires-python2-6-webfaction)

This question is marked "community wiki".

asked Jul 11 '12 at 23:23

Dave%20Stevens's gravatar image

Dave Stevens
8129

edited Jul 11 '12 at 23:24


Thank you very much, this worked for me

answered Jul 19 '12 at 12:14

DomA's gravatar image

DomA
1

Found quicker to change the hardlink to python 2.6v during the installation.

1
2
3
4
5
ln -f /usr/bin/python2.6 /usr/bin/python

cd ~/PATH_TO_UNPACKED_NODE_TARBALL_FOLDER/
./configure
make && make install

Return back to old version.

1
ln -f /usr/bin/python2.x /usr/bin/python

answered Oct 09 '12 at 17:28

insan3's gravatar image

insan3
2

You can't run "ln -f /usr/bin/python2.6 /usr/bin/python" on a WebFaction server, since that would require root access.

(Oct 09 '12 at 17:47) seanf ♦♦ seanf's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×19

Asked: Jul 11 '12 at 23:23

Seen: 1,598 times

Last updated: Nov 21 '12 at 11:07

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited