node-modules / agentkeepalive

Support keepalive http agent.
MIT License
579 stars 57 forks source link

Can't load module #12

Closed strawhatgami closed 9 years ago

strawhatgami commented 9 years ago

Hello, When using those lines at the start of my route:

    var https = require('https');
    var HttpsAgent = require('agentkeepalive').HttpsAgent;

I get:

/home/vagrant/node_modules/agentkeepalive/lib/agent.js:22
var debug = util.debuglog('http');
                 ^
TypeError: Object #<Object> has no method 'debuglog'
    at Object.<anonymous> (/home/vagrant/node_modules/agentkeepalive/lib/agent.js:22:18)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/vagrant/node_modules/agentkeepalive/index.js:1:80)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/vagrant/auth/connection-bd.js:2:18)
JacksonTian commented 9 years ago

you should use 0.11.x for the debuglog api.

发自我的 iPhone

在 2014年10月19日,下午9:22,strawhatgami notifications@github.com 写道:

Hello, When using those lines at the start of my route:

var https = require('https');
var HttpsAgent = require('agentkeepalive').HttpsAgent;

I get:

/home/vagrant/node_modules/agentkeepalive/lib/agent.js:22 var debug = util.debuglog('http'); ^ TypeError: Object # has no method 'debuglog' at Object. (/home/vagrant/node_modules/agentkeepalive/lib/agent.js:22:18) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/home/vagrant/node_modules/agentkeepalive/index.js:1:80) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/home/vagrant/auth/connection-bd.js:2:18) — Reply to this email directly or view it on GitHub.

strawhatgami commented 9 years ago

JacksonTian: this debuglog: https://www.npmjs.org/package/debuglog ?

haoxins commented 9 years ago

@strawhatgami maybe you need agentkeepalive@0.2.3, agentkeepalive 1.x.x only support node 0.11+

strawhatgami commented 9 years ago

@coderhaoxin: that was it: I have an old version of Node (0.10). I'm a bit ashamed cause it's indicated on the README... sorry.