javascript – Node.js Error: connect ECONNREFUSED

javascript – Node.js Error: connect ECONNREFUSED

Chances are you are struggling with the node.js dying whenever the server you are calling refuses to connect. Try this:

process.on(uncaughtException, function (err) {
    console.log(err);
}); 

This keeps your server running and also give you a place to attach the debugger and look for a deeper problem.

I was having the same issue with ghost and heroku.

heroku config:set NODE_ENV=production 

solved it!

Check your config and env that the server is running on.

javascript – Node.js Error: connect ECONNREFUSED

Youre trying to connect to localhost:8080 … is any service running on your localhost and on this port? If not, the connection is refused which cause this error. I would suggest to check if there is anything running on localhost:8080 first.

Leave a Reply

Your email address will not be published.