- [root@localhost pkgs]# wget http://nodejs.org/dist/node-v0.6.4.tar.gz
網速慢,等等吧。。。。。。。。。。。。。。。。。。。。
- [root@localhost build]# tar zxvf ../pkgs/node-v0.6.4.tar.gz
- [root@localhost build]# ./configure --prefix=/usr/local/node
- [root@localhost build]# make && make install
編譯安裝時間也比較長,等。。。。。。。。。。。。。。。
安裝好之後進行測試 :
- var http = require('http');
- http.createServer(function(req,res){
- res.writeHead(200,{'Context-Type':'text/plain'});
- res.end('Hello ,my node.js\n');
- }).listen(8888,"127.0.0.1");
- [root@localhost nodeJS]# /usr/local/node/bin/node test.js
可以看到已經訪問成功了。
OK。安裝測試學到這裡了。