sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
git clone git://github.com/ry/node.git (下载原码)
然后
./configure
make
sudo make install
编写如下小程序,命名为example.js,保存在node文件夹下。
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('hello world');
}).listen(8124, "127.0.0.1");
console.log('Server running at http://127.0.0.1:8124/');
执行node example.js