简体   繁体   English

使用PYTHON的备用安装来安装node.js

[英]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? 如何强制makemake install命令使用python 2.7的替代安装?

I'm a complete beginner to linux commands. 我是linux命令的完整入门者。

I accomplished this by doing the following. 我通过执行以下操作完成了此任务。 Full process 全过程

  1. yum update -y
  2. yum -y groupinstall "Development Tools"
  3. installed git ... followed this ( https://stackoverflow.com/a/8327476/888640 ) 安装了git ...遵循此( https://stackoverflow.com/a/8327476/888640
  4. Installed alternate version of PYTHON 已安装PYTHON的备用版本
  5. wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
  6. tar -xvzf Python-2.7.2.tgz
  7. cd Python-2.7.2
  8. ./configure
  9. make altinstall
  10. cd
  11. use the correct python version 使用正确的python版本
  12. mv /usr/bin/python /usr/bin/python.old
  13. ln -s /usr/local/bin/python2.7 /usr/bin/python
  14. install node 安装节点
  15. cd node
  16. ./configure
  17. make
  18. make install
  19. change back to normal version of python 改回普通版本的python
  20. mv /usr/bin/python.old /usr/bin/python

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM