Tuesday, 15 April 2014

Node.js Jsdom returning [Error: socket hang up] code: 'ECONNRESET' } -



Node.js Jsdom returning [Error: socket hang up] code: 'ECONNRESET' } -

trying utilize jsdom under nodejs , receiving error:

[error: socket hang up] code: 'econnreset' }

using nodejs v0.8.20, ubuntu 12.04

var jsdom = require("jsdom"); jsdom.env({ html: 'http://www.google.com', scripts: ['http://code.jquery.com/jquery.js'], done: function (errors, window) { console.log(errors); } });

http://clock.co.uk/tech-blogs/preventing-http-raise-hangup-error-on-destroyed-socket-write-from-crashing-your-nodejs-server

basically there bug socket hang errors suppressed, in node 0.8.20 no longer suppressed. however, modules don't hear error event yet.

so... downgrade node.js version , wait until jsdom fixes it, or utilize domains. pretty sure issue jsdom using older version of request. or can not utilize http parts of jsdom.

node.js jsdom

No comments:

Post a Comment