Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is request support with nodejs 0.12 #1414

Closed
stableShip opened this issue Feb 7, 2015 · 8 comments · Fixed by #1468
Closed

Is request support with nodejs 0.12 #1414

stableShip opened this issue Feb 7, 2015 · 8 comments · Fixed by #1468

Comments

@stableShip
Copy link

update nodejs to 0.12 from 0.10.36 . request -v: 2.53.0 . This Error occur:
image

@timmckenzie
Copy link

Confirmaiton, all tests passed in node 0.10.36, but failed in 0.12.0. Running on OSX.

ok test-agentOptions.js ............. 4/4
ok test-basic-auth.js ............. 19/19
ok test-bearer-auth.js ............ 14/14
ok test-body.js ................... 13/13
ok test-cookies.js ................ 17/17
ok test-defaults.js ............... 23/23
ok test-digest-auth.js ............ 11/11
ok test-emptyBody.js ................ 9/9
ok test-errors.js ................... 8/8
ok test-event-forwarding.js ......... 4/4
ok test-follow-all-303.js ........... 3/3
ok test-follow-all.js ............... 3/3
ok test-form-data-error.js .......... 1/1
ok test-form-data.js .............. 40/40
ok test-form-urlencoded.js ........ 12/12
ok test-form.js ................... 18/18
ok test-gzip.js ................... 17/17
ok test-hawk.js ..................... 3/3
not ok test-headers.js ............ 20/22
ok test-http-signature.js ........... 4/4
ok test-httpModule.js ............. 50/50
not ok test-https.js .............. 10/20
ok test-isUrl.js .................. 15/15
ok test-json-request.js ........... 27/27
ok test-localAddress.js ............. 5/5
ok test-multipart.js .......... 1136/1136
ok test-node-debug.js ............. 20/20
ok test-oauth.js .................. 47/47
ok test-onelineproxy.js ............. 3/3
ok test-option-reuse.js ........... 10/10
ok test-params.js ................. 12/12
ok test-piped-redirect.js ........... 2/2
ok test-pipes.js .................. 27/27
ok test-pool.js ..................... 4/4
not ok test-proxy-connect.js ........ 4/5
ok test-proxy.js ................ 104/104
ok test-qs.js ..................... 16/16
ok test-redirect-auth.js .......... 18/18
ok test-redirect-complex.js ....... 40/40
ok test-redirect.js ............... 67/67
ok test-rfc3986.js ................ 22/22
ok test-timeout.js .................. 9/9

@jspavlick
Copy link

I can confirm that this also happened to me, upgrading from Node.js 0.10.36 to 0.12.0 on OS X.

@chenchaoyi
Copy link

For me it looks this commit causing the failure nodejs/node-v0.x-archive@f347573

Uncaught TypeError: msecs must be a number
      at Object.exports.enroll (timers.js:156:11)
      at Socket.setTimeout (net.js:329:12)
      at ClientRequest.<anonymous> (_http_client.js:558:10)
      at ClientRequest.g (events.js:199:16)
      at ClientRequest.emit (events.js:129:20)
      at tickOnSocket (_http_client.js:486:7)
      at _http_client.js:497:7
      at process._tickCallback (node.js:355:11)

@raitucarp
Copy link

could you upgrade request npm package?

@murataka
Copy link

murataka commented Apr 6, 2015

i installed nodejs v0.12.2 from scratch and the output in my source is

Message: msecs must be a number

Stacktrace:

TypeError: msecs must be a number
at Object.exports.enroll (timers.js:156:11)
at TLSSocket.Socket.setTimeout (net.js:337:12)
at ClientRequest. (_http_client.js:565:10)
at ClientRequest.g (events.js:199:16)
at ClientRequest.emit (events.js:129:20)
at tickOnSocket (_http_client.js:493:7)
at _http_client.js:504:7
at process._tickCallback (node.js:355:11)


@froatsnook
Copy link
Contributor

@murataka I'm using request on node 0.12, so it must be another problem. Can you post the code that produced the error?

@murataka
Copy link

murataka commented Apr 8, 2015

//// here begins function //////
downloadfile = function (file, to, myfun) {

var options = {
    url: file
};

// here it raises the error
get.get(options, "public/img/user/" + to, function (error, result) {
if (error) {
console.error(error);
} else {

        if (myfun) myfun(result.file);
        //  console.log('File downloaded at: ' + );
    }
});

}
////////// here ends function ////////////

var dtid="murataka";

downloadfile("https://graph.facebook.com/" + dtid + "/picture","/root/public/destination.jpg", function (image) {

                                });

@murataka
Copy link

murataka commented Apr 8, 2015

I have solved the problem modifying the options parameter. In older version , options did have a default value i think.


var options = {
url: file,
timeout:1000
};


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants