【发布时间】:2012-03-18 19:49:54
【问题描述】:
我刚刚从在线教程中获取了该代码:
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(3000, 'my.ip.is.here');
console.log('Server running at http://my.ip.is.here:3000/');
当我开始时:
node app.js
我收到以下错误:
events.js:48 抛出论据1; // 未处理的“错误”事件 ^ 错误:接受 ENOSYS 在 errnoException (net.js:614:11) 在 TCP.onconnection (net.js:788:24)
我在 ubuntu 11.10 服务器 VPS 上,我有 nginx 作为 Web 服务器,但它没有启动。
我做错了吗?
【问题讨论】:
-
ENOSYS 在系统不支持某个功能时发生。这可能与在 VPS 上有关 - 您是否在本地计算机上尝试过?
-
解决了,感谢您的意见
-
不用担心,很高兴你能成功。几天后,您将能够接受自己的答案