Node学习(一)--安装Node

  1. linux下搭建环境

  2. 确认系统已经安装g++4.6以上,Python 2.6以上

  3. wget http://nodejs.org/dist/v0.10.35/node-v0.10.35.tar.gz

  4. tar -zvxf node-v0.10.35.tar.gz

  5.  $ ./configure

  6.  $ make

  7.  $ sudo make install

  8. node -v


  9. var http = require("http");
    http.createServer(function(req,res){
            res.writeHead(200,{'Content-Type':'text/plain'});
            res.end('Hello Node.js\n');
    }).listen(1337,'192.168.1.128');
    console.log("server listen at 1337");


10.http://xxxx:1337

11.安装node-gyp模块用于编译源文件

   npm install -g node-gyp



你可能感兴趣的:(Node学习(一)--安装Node)