Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

process.nextTick error, or 'error' event on first tick error #133

Closed
sononix opened this Issue · 7 comments

2 participants

@sononix

getting an error message when trying to run one of the examples

require('node.io').scrape(function() {
this.getHtml('http://www.reddit.com/', function(err, $) {
var stories = [];
$('a.title').each(function(title) {
stories.push(title.text);
});
this.emit(stories);
});
});

heres the error below

node.js:116
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Cannot read property 'prototype' of undefined
at Object. (/Users/ms/CODE/NODE/node_modules/node.io/node_modules/request/forever.js:97:55)
at Module._compile (module.js:373:26)
at Object..js (module.js:379:10)
at Module.load (module.js:305:31)
at Function._load (module.js:271:10)
at require (module.js:317:19)
at Object. (/Users/ms/CODE/NODE/node_modules/node.io/node_modules/request/main.js:25:20)
at Module._compile (module.js:373:26)
at Object..js (module.js:379:10)
at Module.load (module.js:305:31)

any ideas
M

@chriso
Owner

Looks like a bug in the request library => (/Users/ms/CODE/NODE/node_modules/node.io/node_modules/request/forever.js:97)

Try doing a fresh install of node.io

$ rm -rf node_modules/node.io
$ npm install node.io
@sononix

tried that - no improvement - how can I change the version of the request package, at the moment "request": "2.9.202" is being used, current request is version 2.12.0 though is that compatible ?

by the way Im using node v0.4.0 under an npm install and have node_modules being installed locally in a project rather than globally

@chriso
Owner

node.io depends on request 2.9.202 for now. I'd say it's probably an issue with node v0.4.0 which is coming up on 2 years old. Any chance you could upgrade to 0.8?

@chriso
Owner

Yep, you need to upgrade. The request library relies on require('https').Agent which was added in v0.6 I believe

@chriso chriso closed this
@sononix

is there a specific version of 0.8 - I was getting errors with both, and saw the node engine was given as

"engines": { "node": ">=0.4.0" }, in the package file

so I thought it might work with 4

@chriso
Owner

The latest release v0.8.15 should be fine. If you get another issue then post a stack trace and I'll take a look.

The node.io code is compatible with node >= 0.4.0 but the dependencies seem to be relying on newer features since I last checked. I'll upgrade the package.json to reflect this.

@sononix

works fine now tks
M

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.