http.js error #13

Closed
KevinEtienne opened this Issue Jan 27, 2011 · 2 comments

2 participants

@KevinEtienne

Running the first example of the wiki to scrape a webpage (equivalent of curl -v http://example.com) I'm getting the following error:

node.io scrape.js "http://perdu.com/"
<html><head><title>Vous Etes Perdu ?</title></head><body><h1>Perdu sur l'Internet ?</h1><h2>Pas de panique, on va vous aider</h2><strong><pre>    * <----- vous êtes ici</pre></strong></body></html>


http.js:330
  this.socket.destroy(error);
              ^
TypeError: Cannot call method 'destroy' of null
    at ClientRequest.destroy (http.js:330:15)
    at /Users/kev/local/lib/node/.npm/node.io/0.2.1-15/package/lib/node.io/request.js:225:25
    at IncomingMessage. (/Users/kev/local/lib/node/.npm/node.io/0.2.1-15/package/lib/node.io/request.js:322:13)
    at IncomingMessage.emit (events.js:59:20)
    at HTTPParser.onMessageComplete (http.js:111:23)
    at Socket.ondata (http.js:990:22)
    at Socket._onReadable (net.js:623:27)
    at IOWatcher.onReadable [as callback] (net.js:156:10)
$ npm list installed
npm info it worked if it ends with ok
npm info using npm@0.2.16
npm info using node@v0.3.7-pre
coffee-script@1.0.0   =jashkenas active installed latest remote stable   Unfancy JavaScript     javascript language coffeescrip
daemon@0.1.0          =indexzero active installed latest remote stable   Add-on for creating *nix daemons    
expresso@0.7.2        =tjholowaychuk active installed latest remote   TDD framework, light-weight, fast, CI-friendly    
htmlparser@1.7.3      =tautologistics active installed latest remote   Forgiving HTML/XML/RSS Parser in JS for *both* Node and 
node.io@0.2.1-15      =cohara87 active installed remote   A distributed data scraping and processing framework for node.js     
node.io@0.2.1-17      =cohara87 installed remote   A distributed data scraping and processing framework for node.js     data ma
node.io@0.2.1-18      =cohara87 installed latest remote   A distributed data scraping and processing framework for node.js     
nodeunit@0.5.0        =caolan active installed latest remote   Easy unit testing for node.js and the browser.    
npm@0.2.15            =isaacs installed remote   A package manager for node     package manager modules install package.json
npm@0.2.16            =isaacs active installed latest remote   A package manager for node     package manager modules install p
soupselect@0.2.0      =harryf active installed latest remote   Adds CSS selector support to htmlparser for scraping activities 
validator@0.1.6       =cohara87 active installed latest remote   Data validation, filtering and sanitization for node.js     va
npm ok
@chriso

Hey, it's no doubt the version of node you're using (0.3.7-pre) - the node request API is constantly changing and I haven't tested it beyond the latest unstable release (0.3.6). It also looks like node.io(1) is pointing to an older version (0.2.1-15) even though you have the newest version installed. Try reinstalling node.io with npm install node.io.

-Chris

@KevinEtienne

hi chriso, thanks for your quick answer, I've downgraded node to 0.3.5 and I could run through the examples. Sorry I didn't notice that my problem was related in some way to your answer to this pull request #12

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment