节点TypeError的jQuery:需要一个'context'参数

时间:2012-03-12 10:26:20

标签: jquery node.js

我正在尝试在线部署我的node.js服务器。在我的机器上一切正常,但当在线移动服务器并运行节点时,我收到此错误:

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
TypeError: needs a 'context' argument.
    at Object.getGlobal (/my/path/CloudServer/node_modules/jquery/node_modules/jsdom/lib/jsdom/browser/index.js:26:21)
    at Object.createWindow (/my/path/CloudServer/node_modules/jquery/node_modules/jsdom/lib/jsdom/browser/index.js:308:23)
    at Object.windowAugmentation (/my/path/CloudServer/node_modules/jquery/node_modules/jsdom/lib/jsdom/browser/index.js:63:24)
    at Object.parentWindow (/my/path/CloudServer/node_modules/jquery/node_modules/jsdom/lib/jsdom/browser/index.js:605:28)
    at Object.<anonymous> (/my/path/CloudServer/node_modules/jquery/node_modules/jsdom/lib/jsdom.js:81:15)
    at create (/my/path/CloudServer/node_modules/jquery/node-jquery.js:5:47)
    at /my/path/CloudServer/node_modules/jquery/node-jquery.js:9065:18
    at Object.<anonymous> (/my/path/CloudServer/node_modules/jquery/node-jquery.js:9067:1)
    at Module._compile (module.js:432:26)
    at Object..js (module.js:450:10)

现在,我一直在尝试跟踪堆栈跟踪,但我无法弄清楚错误来自哪里。由于堆栈在节点的jquery中显示大部分问题然后我猜问题就在那里。有谁知道该怎么办?

由于

2 个答案:

答案 0 :(得分:1)

我知道它可能不是一个有效的解决方案,但在我升级到节点0.12之后,这个错误就消失了。

答案 1 :(得分:0)

我通过从项目中删除node.js的jQuery来解决这个问题。如果有人发现某些东西可以在这里发布,我会将其标记为正确,如果有效的话。