nodejs学习1

1.安装
2.node测试是否安装成功
3.hello world

var http = require("http");
http.createServer(function(req, res){
	res.writeHeader("Content-Type", "text/plain");
	res.end("<h3>hello</h3>");
}).listen(5000, "127.0.0.1");
4.npm安装依赖包
本地安装
npm install <package name>

npm install <package name>@version

全局安装
npm install <package name> -S
查看文档
npm docs <package>
npm bugs <package>

一次性安装:
定义package.json

{
“name”: “npmtest1″,
“version”: “0.0.1″,
“dependencies”: {
“integration”: “*”,
“underscore”: “*”
}
}

在package.json同目录下执行 npm install