开发者

Install node.js on PowerVPS

开发者 https://www.devze.com 2023-01-26 13:25 出处:网络
I have one VPS from PowerVPS which has CentOS 5.5 (default configuration). I need to install Node.JS for an Ajax IM installation.

I have one VPS from PowerVPS which has CentOS 5.5 (default configuration).

I need to install Node.JS for an Ajax IM installation.

Does 开发者_运维知识库anyone have any advice/information on how to install Node.JS on the machine?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消