{
// save before running commands
"save_first": true,
// if present, use this command instead of plain "node"
// e.g. "/usr/bin/node" or "C:\bin\node.exe"
// e.g. "/usr/bin/node" or "C:\bin\node.exe"
"node_command": "D:\\ProgramFiles\nodejs\node.exe", //是Nodejs安装目录
// Same for NPM command
"npm_command": "D:\\ProgramFiles\nodejs\npm.cmd",
// as 'NODE_PATH' environment variable for node runtime
//"node_path": false,
"expert_mode": false,
"ouput_to_new_tab": false
}
9.验证,复制下面代码 到sublime一个新建文件中。 并Ctrl+ b 编译这段代码。 即时窗口显示:Server running at http://127.0.0.1:80/ ,然后打开浏览器敲入这个地址并显示内容hello nodejs 。 这是一个简单的站点发布。
var http = require('http');
var os = require('os');
http.createServer(function (request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello nodejs\n');
}).listen(80);
console.log('Server running at http://127.0.0.1:80/');