访问https://nodejs.org/en/download/urlnode
根据您的系统是32位或64位,按照文字说明进行下载浏览器
双击运行nodejs的安装包,并指定到一个nodejs目录ui
咱们在任何目录新建一个hello.jsurl
键入如下内容:调试
var http = require("http");
http.createServer(function(request,response){
response.writeHead(200, {
"Content-Type" : "text/plain"
});
response.write("Hello World!");
}).listen(8888);
而后打开控制台,在控制台中进行hello.js的目录,get
运行node hello.jsit
再打开浏览器,就能够看到Hello World!了io
文章为做者原创,转载请注册出处 http://www.zizhusoft.com/note/show.aspx?id=e8f2ac7e-0e27-49b2-8802-3e97d9034f42 ,谢谢 function