一、安装和测试
1.安装去官网下个包,一键安装。
2.安装后运行 使用node.js command prompt 命令窗口 或者 使用windows 自带dos窗口
3.测试安装代码(网上到处都是一样的)
var http = require("http");
http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("test nodjs");
response.end();
}).listen(8899);
console.log("nodejs start listen 8899 port!");
4.保存为 node.js 到D: 盘
5. 运行 node d:\\node.js
6.保持窗口,打开浏览器访问:http://127.0.0.1:8899/。看到test nodjs。测试成功!