[英]Install node.js using alternate install of PYTHON
My server is running CentOS 5.8 and uses PYTHON 2.4 我的服务器正在运行CentOS 5.8,并使用PYTHON 2.4
I installed an alternate version of PYTHON 2.7 to use to install node.js 我安装了PYTHON 2.7的备用版本以用于安装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. 当我运行
make
命令时,出现错误。
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. 我相信是因为它使用的是2.4版本的python。 How can I force the
make
and make install
command use my alternate install of python 2.7? 如何强制
make
和make install
命令使用python 2.7的替代安装?
I'm a complete beginner to linux commands. 我是linux命令的完整入门者。
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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.