0

当我尝试运行我的 Co.app 时,我得到

TypeError: Cannot call method 'apply' of undefined
    at /home/ecarroll/code/chrome-okc-plugin/node_modules/thunkify/index.js:32:8
    at /home/ecarroll/code/chrome-okc-plugin/test.js:12:17
    at GeneratorFunctionPrototype.next (native)
    at next (/home/ecarroll/code/chrome-okc-plugin/node_modules/co/index.js:70:21)
    at /home/ecarroll/code/chrome-okc-plugin/node_modules/co/index.js:50:5
    at Object.<anonymous> (/home/ecarroll/code/chrome-okc-plugin/test.js:13:4)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:349:32)
    at Function.Module._load (module.js:305:12)
4

1 回答 1

0

此错误是您对未定义的内容进行 thunkify 处理的结果,例如这个...

var readdir = thunkify(readdir);

当你想要的时候,

var readdir = thunkify(fs.readdir);
于 2014-03-02T09:59:18.937 回答