WebFaction
Community site: login faq

I saw this issue http://community.webfaction.com/questions/75/issue-nodejs-installation and this one http://forum.webfaction.com/viewtopic.php?id=3612&p=1

I'm running this command inside , ~/sources/node-v0.2.4 ./configure –jobs=1 –prefix=$HOME

And getting this error

File "/home/bennybobw/sources/node-v0.2.4/tools/waf-light", line 157, in ?
import Scripting
File "/home/bennybobw/sources/node-v0.2.4/tools/wafadmin/Scripting.py", line 9, in ?
import Utils, Configure, Build, Logs, Options, Environment, Task
File "/home/bennybobw/sources/node-v0.2.4/tools/wafadmin/Build.py", line 18, in ?
import Runner, TaskGen, Node, Scripting, Utils, Environment, Task, Logs, Options
File "/home/bennybobw/sources/node-v0.2.4/tools/wafadmin/TaskGen.py", line 54, in ?
class task_gen(object):
File "/home/bennybobw/sources/node-v0.2.4/tools/wafadmin/TaskGen.py", line 87, in task_gen
traits = Utils.DefaultDict(set)
NameError: name 'set' is not defined

When I try to run make I get:

Traceback (most recent call last):
File "tools/waf-light", line 157, in ?
import Scripting
File "/home/bennybobw/sources/node-v0.2.4/tools/wafadmin/Scripting.py", line 9, in ?
import Utils, Configure, Build, Logs, Options, Environment, Task
File "/home/bennybobw/sources/node-v0.2.4/tools/wafadmin/Build.py", line 18, in ?
import Runner, TaskGen, Node, Scripting, Utils, Environment, Task, Logs, Options
File "/home/bennybobw/sources/node-v0.2.4/tools/wafadmin/TaskGen.py", line 54, in ?
class task_gen(object):
File "/home/bennybobw/sources/node-v0.2.4/tools/wafadmin/TaskGen.py", line 87, in task_gen
traits = Utils.DefaultDict(set)
NameError: name 'set' is not defined 
make: *** [all] Error 1

Thanks

asked 05 Nov '10, 12:15

bennybobw
1123
accept rate: 0%

edited 05 Nov '10, 12:15


In case anyone stumbles onto this page in the future, you're likely wanting to install a newer version of Node.js, in which case this guide details that process. Hope that helps!

permanent link

answered 11 Oct '12, 00:29

ryans ♦♦
5.0k93360
accept rate: 43%

edited 20 Jun '14, 05:27

The problem is that your server is really quite old and is running Python 2.3 by default. A quick bit of sed-fu will force all the scripts to use Python 2.6:

wget http://nodejs.org/dist/node-v0.2.4.tar.gz
tar zxf node-v0.2.4.tar.gz 
cd node-v0.2.4
grep -ri "bin/env python" . | cut -d ":" -f 1 | xargs sed -i 's/env python/env python2.6/'
./configure --jobs=1 --prefix=$HOME
make
make install
permanent link

answered 05 Nov '10, 12:28

David L ♦♦
1.4k13
accept rate: 45%

Your account is on one of our older servers that uses Python 2.3 as the default system Python. I think that if you set a newer version of Python as your default, then you won't have this problem any more.

Hope that helps!

Edit: this doesn't work, because the build scripts are invoking Python via /usr/bin/env python. The env command doesn't recognized bash aliases - instead, it searches your $PATH. On your server, the 'python' on your $PATH is Python 2.3, so that's what the build script uses. So, I think you should use David L's suggestion of modifying the build scripts (with sed) to force them to run Python 2.6.

permanent link

answered 05 Nov '10, 12:31

seanf
12.2k41836
accept rate: 37%

edited 06 Nov '10, 16:46

David L, So using your suggestion I got ./configure to run successfully, but make failed with the same error.

Traceback (most recent call last):
  File "tools/waf-light", line 157, in ?
    import Scripting
  File "/home/bennybobw/sources/node-v0.2.4/tools/wafadmin/Scripting.py", line 9, in ?
    import Utils, Configure, Build, Logs, Options, Environment, Task
  File "/home/bennybobw/sources/node-v0.2.4/tools/wafadmin/Build.py", line 18, in ?
    import Runner, TaskGen, Node, Scripting, Utils, Environment, Task, Logs, Options
  File "/home/bennybobw/sources/node-v0.2.4/tools/wafadmin/TaskGen.py", line 54, in ?
    class task_gen(object):
  File "/home/bennybobw/sources/node-v0.2.4/tools/wafadmin/TaskGen.py", line 87, in task_gen
    traits = Utils.DefaultDict(set)
NameError: name 'set' is not defined
make: *** [all] Error 1

Seanf, I set python in my .bash_profile python --version gives me Python 3.1, but ./configure still fails.

(05 Nov '10, 14:28) bennybobw

It's unlikely that the Node build script it compatible with Python 3.1. Try using Python 2.6 instead.

(05 Nov '10, 14:36) seanf

Seanf, Same issue I get the make error above with Python 2.6.5, NameError: name 'set' is not defined

(05 Nov '10, 15:55) bennybobw

I've replied to your ticket with a possible workaround.

(05 Nov '10, 18:17) klynton
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:

×67
×34
×7
×1

question asked: 05 Nov '10, 12:15

question was seen: 5,965 times

last updated: 20 Jun '14, 05:27

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