【发布时间】:2014-06-30 08:46:54
【问题描述】:
在运行节点脚本时使用 node.js 时出现此错误,不知道我在哪里出错
events.js:72
throw er; // Unhandled 'error' event
^
错误:连接 ENOTSOCK 在 errnoException (net.js:904:11) 在 Object.afterConnect [as oncomplete] (net.js:895:19)
这是我用来连接服务器的脚本代码
var net = require('net');
// createConnection
var connection = net.createConnection({port: 8181, host:'/path/to/local_host/',path:'/Applications/XAMPP/xamppfiles/htdocs'},
// connectListener callback
function() {
console.log('connection successful');
});
【问题讨论】:
标签: node.js