这是我运行位于http://nodejs.org/的“ Hello
World”示例所采取的确切步骤。这是一个快速而肮脏的例子。对于永久安装,您希望将可执行文件存储在比根目录更合理的位置,并更新您的可执行文件
PATH以包含其位置。
- 在此处下载Windows可执行文件:http : //nodejs.org/#download
- 将文件复制到C:
- 创建C: hello.js
粘贴以下内容:
var http = require('http');http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn');}).listen(1337, "127.0.0.1");console.log('Server running at http://127.0.0.1:1337/');保存文件
- 开始->运行…-> cmd
- C:
- C:>节点hello.js
Server running at http://127.0.0.1:1337/
而已。这是在Windows XP上完成的。



