Install node.js on PowerVPS

对着背影说爱祢 提交于 2019-12-04 15:08:29
Rob Yates

Although this is not "officially supported" (meaning support will help troubleshoot problems and such), this is pretty easy to do.

Login to the server via SSH. Then run the following commands:


cd /root
wget http://nodejs.org/dist/v0.8.8/node-v0.8.8.tar.gz
gunzip node-v0.8.8.tar.gz
tar -xf node-v0.8.8.tar.gz
cd node-v0.8.8
./configure
make
make install

After those commands are run, you should be able to type which node to see the full path to the binary.

[root@host ~]# which node
/usr/local/bin/node

To test, you can create a new file with the following contents:

var sys = require("sys");
sys.puts("Hello World!");

Save it and then run it. I named my test file 'foo.js'.

[root@host ~]# node foo.js
Hello World!

That should do it. If you get errors, make sure you have GCC installed. (yum install gcc)

Hope that helps!

Rob Yates

Sales Engineer

PowerVPS / Virtacore Systems

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!