简体   繁体   中英

Install node.js using alternate install of PYTHON

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

  1. yum update -y
  2. yum -y groupinstall "Development Tools"
  3. installed git ... followed this ( https://stackoverflow.com/a/8327476/888640 )
  4. Installed alternate version of 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
  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
  20. 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.

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