My server is running CentOS 5.8 and uses PYTHON 2.4
I installed an alternate version of PYTHON 2.7 to use to install node.js
I have followed several different tutorials to get to this point and need a little help to finish
i am in the node directory and used this command for configure
/usr/bin/env python2.7 ./configure
when I ran the make
command there was an error.
File "../../tools/js2c.py", line 387
except Error as e:
^
SyntaxError: invalid syntax
make[1]: *** [/root/node/out/Release/obj/gen/libraries.cc] Error 1
make[1]: Leaving directory `/root/node/out'
make: *** [node] Error 2
I believe that's because it's using the 2.4 version of python. How can I force the make
and make install
command use my alternate install of python 2.7?
I'm a complete beginner to linux commands.
I accomplished this by doing the following. Full process
yum update -y
yum -y groupinstall "Development Tools"
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar -xvzf Python-2.7.2.tgz
cd Python-2.7.2
./configure
make altinstall
cd
mv /usr/bin/python /usr/bin/python.old
ln -s /usr/local/bin/python2.7 /usr/bin/python
cd node
./configure
make
make install
mv /usr/bin/python.old /usr/bin/python
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.