step1:安装Node.js
1.#sudo mkdir node.js
2.#cd node.js
3.#sudo wget http://nodejs.org/dist/v0.10.32/node-v0.10.32.tar.gz
4.#sudo tar xvf node-v0.10.32.tar.gz
5.#cd node-v0.10.32
6.#sudo ./configure #这一步时间老长了,我觉得跟储存卡有点关系,回头我去买一张Class10的告诉卡试试
7.#sudo make
8.#sudo make install
9.#cp /usr/local/bin/node /usr/sbin/
10.#node -v //out v0.10.32
Step 2:测试
1.#sudo nano test.js
2.编辑保存
var http = require("http");
var server = function(req,res){
res.writeHead(200,{"Content-type":"text/html"});
res.end("<h1>Kisshc Welcome to Raspberry Pi!</h1>");
}
http.createServer(server).listen(8000,function(){
console.log("The system startting!");
});
3.#sudo node test.js