我刚刚从一个在线教程中获得了代码:
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Worldn');
}).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:641:11)在TCP.onnection(net.js:788:24)
我在一个ubuntu 11.10服务器VPS上,我有nginx作为web服务器,但它还没有启动。
我做错什么了吗?
我的node.js版本是从我尝试的git rep到nodejs.org的版本,现在运行良好。