WebFaction
Community site: login 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 11 Jul '12, 23:23

Dave Stevens
811512
accept rate: 50%

edited 11 Jul '12, 23:24


Thank you very much, this worked for me

permanent link

answered 19 Jul '12, 12:14

DomA
1
accept rate: 0%

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

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.

ln -f /usr/bin/python2.x /usr/bin/python
permanent link

answered 09 Oct '12, 17:28

insan3
2
accept rate: 0%

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

(09 Oct '12, 17:47) seanf
Your answer
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

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×34

question asked: 11 Jul '12, 23:23

question was seen: 7,903 times

last updated: 21 Nov '12, 11:07

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM