Cannot configure node.js for make install on OS X (Snow Leopard)

I cloned a node git repo, but the waf build tool that comes with node does not seem to work with the latest version of Python.

$ ./configure Traceback (most recent call last): File "/Users/greim/nodestuff/node/tools/waf-light", line 157, in <module> import Scripting File "/Users/greim/nodestuff/node/tools/wafadmin/Scripting.py", line 146 except Utils.WafError, e: ^ SyntaxError: invalid syntax $ which python /Library/Frameworks/Python.framework/Versions/3.0/bin/python 

If I understand this comma is an obsolete syntax that doesn't work in Python 3, right?

I would prefer not to install the old version of Python just for this. Ideally, I would like to be able to create and install the latest version, and not depend on others to distribute .dmg files.

Scala and a difficult place? Recommendations?


[update] OK, so thanks to everyone who helped answer this question. Hope others find this on Google. As it turns out, I have Python 2.x on my system (it is installed by default in OS X) in / usr / bin. So the solution was to update my path (not always, just for this bash session).

 $ export PATH=/usr/bin:$PATH $ ./configure $ make $ make install 

TA-dah! node is installed on my system.

+3
source share
2 answers

I waf project page says

Compatible with Python 2.3 to 3.1 (and Jython 2.5)

I think this is currently happening by running 2to3.py when unpacking, so if you ran python2 first, it might have been wrong. In waf1.6 branch, I think python3 clean

Reading node.js code node people have expanded waf - this is not how you are going to use waf. The idea is to put the binary in the source code - it will expand using the correct version of python

There is python 2 in OSX, so the way to start the build may be to edit the make root file and replace the first line

 WAF=python tools/waf-light 

 WAF=/usr/bin/python tools/waf-light 
+3
source

Yes, the comma is deprecated: see http://www.python.org/dev/peps/pep-3110/

Unfortunately, there are not many solutions, if you stick with python3, you will have to modify the node code to make it work.

+1
source

All Articles