login community 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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 Nov 05 '10 at 12:15

bennybobw's gravatar image

bennybobw
112

edited Nov 05 '10 at 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!

answered Oct 11 '12 at 00:29

ryans's gravatar image

ryans ♦♦
28411420

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:

1
2
3
4
5
6
7
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

answered Nov 05 '10 at 12:28

David%20L's gravatar image

David L ♦♦
132113

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.

answered Nov 05 '10 at 12:31

seanf's gravatar image

seanf ♦♦
56291220

edited Nov 06 '10 at 16:46

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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.

(Nov 05 '10 at 14:28) bennybobw bennybobw's gravatar image

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

(Nov 05 '10 at 14:36) seanf ♦♦ seanf's gravatar image

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

(Nov 05 '10 at 15:55) bennybobw bennybobw's gravatar image

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

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

×21
×19
×5
×1

Asked: Nov 05 '10 at 12:15

Seen: 2,420 times

Last updated: Oct 11 '12 at 00:29

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