16

I downloaded node.js through a link that was not joyent, and it gave me an old version of node. So I wanted to reinstall node.js with the new git://github.com/joyent/node.git. So I tried running the same clone script over and it gave a fatal error because my node folder isn't empty. So I deleted the node folder and ran it again and it cloned it.

After that I tried running the configure file and I got an error:

File "./configure", line 433
    fpu = 'vfpv3' if armv7 else 'vfpv2'
                   ^
SyntaxError: invalid syntax

I have no idea how to solve a problem? I've tried deleting the node folder and cloning the git again but same error.

Here is the code I found in the file near line 433:

armv7 = is_arch_armv7()
# CHECKME VFPv3 implies ARMv7+ but is the reverse true as well?
fpu = 'vfpv3' if armv7 else 'vfpv2'
Alex
  • 2,350
  • 2
  • 20
  • 17
Tyler
  • 3,713
  • 6
  • 37
  • 63

3 Answers3

45

The issue was that the python script attempting to run the configure file was Python 2.4. So I installed Python 2.7 (I may have had it already), and I ran the script again using:

python2.7 configure

Then it ran correctly.

Tyler
  • 3,713
  • 6
  • 37
  • 63
  • 6
    If you're like me and using CentOS, here's the next thing you'll need to read: http://stackoverflow.com/questions/10624511/upgrade-python-without-breaking-yum – Daniel Kaplan Aug 02 '13 at 23:43
  • 1
    In my case, python 3.3.4 was causing this issue. It is not compatible with python3. – Dingle Mar 29 '14 at 00:35
1

you could use curl to install it from terminal:

$ curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
$ ./configure --jobs=1 --prefix=$HOME
$ make install

install npm:

$ curl http://npmjs.org/install.sh | sh
hereandnow78
  • 14,094
  • 8
  • 42
  • 48
0

Adding to @Samir's answer, here is what you might need to do.

python2.7 configure 
make PYTHON=python2.7

This will configure installation using python2.7 instead of your default python which is probably older than 2.6.

Alternatively after configure you can update top of you Makefile to use the same version of python

PYTHON ?= python2.7
Subash
  • 7,098
  • 7
  • 44
  • 70