Node.js错误:连接ECONN拒绝

我是Node.js新手,无法解决此错误:

错误:在Object.afterConnect(作为oncomplete)errnoException(net.js:901:11)处连接ECONNREFUSED(net.js:892)

我试用的代码如下:

    var async = require('async'),
    request = require('request');

function done(err,results) {
    if (err) {
        throw err;
    }

    console.log('Done ! results: %j',results);
}


var collection = [1,2,3,4];

function iterator(value,callback) {
    request.post({
        url: 'http://localhost:8080',
        body: JSON.stringify(value)
    }, function (err,res,body){
        if (err) {
            callback(err,body && JSON.parse(body));
        }

    });
}

async.map(collection,iterator,done);
链接地址: http://www.djcxy.com/p/87241.html

上一篇: Node.js Error : connect ECONN Refused

下一篇: Phonegap installation issue via cmd nodejs [windows 7]