我的节点应用程序在我的macbook上运行良好,但当我发布到Rackspace上的服务器时,我得到了以下我从未见过的错误(敏感路径替换为...):
[...]/node_modules/jsdom/node_modules/contextify/lib/contextify.js:7
var ctx = new ContextifyContext(sandbox);
^
TypeError: undefined is not a function
at Contextify ([...]/node_modules/jsdom/node_modules/contextify/lib/contextify.js:7:15)
at Object.createWindow ([...]/node_modules/jsdom/lib/jsdom/browser/index.js:303:3)
at Object.windowAugmentation ([...]/node_modules/jsdom/lib/jsdom/browser/index.js:63:24)
at Object.parentWindow ([...]/node_modules/jsdom/lib/jsdom/browser/index.js:605:28)
at Object.<anonymous> ([...]/node_modules/jsdom/lib/jsdom.js:81:15)
at [...]/node_modules/jsdom/lib/jsdom.js:170:52
at Request._callback ([...]/node_modules/jsdom/lib/jsdom.js:275:9)
at Request.callback ([...]/node_modules/request/node_modules/request/main.js:119:22)
at Request.<anonymous> ([...]/node_modules/request/node_modules/request/main.js:525:16)
at Request.emit (events.js:67:17)发布于 2012-04-29 08:02:16
需要编译Contextify来创建.node二进制文件。这些都是用jsdom预先构建的。它在我的mac上运行得很好,但在我发布到的ubuntu服务器上就不行了。根据github页面上的说明在服务器上重建contextify为我修复了这个问题。
https://stackoverflow.com/questions/10359867
复制相似问题