这是我在节点 js 中的代码:
var http = require('http');
var options = {
host : '127.0.0.1',
port: 8124,
path: '/',
method: 'GET'
};
http.request(options, function(res){
console.log("Hello!");
}).end();
process.on('uncaughtException', function(err){
console.log(err);
});
当我编译它时,编译器向我显示以下错误:
编辑:使用快递,但如果我想让它在没有快递的情况下工作,我该怎么办?