我運行first.js
獲取Microsoft JScript中的編譯錯誤
var http = require("http");
http.createServer(function (request, response) {
// Send the HTTP header
// HTTP Status: 200 : OK
// Content Type: text/plain
response.writeHead(200, {'Content-Type': 'text/plain'});
// Send the response body as "Hello World"
response.end('Hello World\n');
}).listen(8124);
// Console will print the message
console.log('Server running at http://127.0.0.1:8124/');
的一段代碼,而I M與gitbash它給人的願望輸出運行它。但使用節點js命令提示它給微軟jscript編譯錯誤。
的node.js無關使用JScript,所以你使用的是錯誤的解釋運行腳本。 – user3173842