1

我一直在寻找最好的 nodejs 框架。我开始倾向于二分法扎帕。我正在对其进行测试,一切正常,直到我开始一个新项目并使用 npm 重新安装它。

现在任何时候我用它做任何事情,它都会抛出这个错误。

这个

require('zappa') ->
    console.log "Hello World!"

变成

TypeError: Cannot read property 'prototype' of undefined
at Object.<anonymous> (/home/giodamelio/Projects/node-boilerplate/node_modules/zappa/lib/zappa.js:65:15)
at Object.<anonymous> (/home/giodamelio/Projects/node-boilerplate/node_modules/zappa/lib/zappa.js:702:4)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)
at Function._load (module.js:311:12)
at Module.require (module.js:359:17)
at require (module.js:375:17)
at Object.<anonymous> (/home/giodamelio/Projects/node-boilerplate/src/app.coffee:3:3)
at Object.<anonymous> (/home/giodamelio/Projects/node-boilerplate/src/app.coffee:52:4)

发生了什么?

4

1 回答 1

4

Recently I just had a similar problem with zappa 0.3.3

Apparently the creator of zappa is on vacation and doesn't update to the current versions of node.js, but you may use zappajs instead. It's a fork that is a little more up-to-date.

npm install zappajs

And use require('zappajs') instead of require('zappa').

于 2012-06-29T19:01:04.860 回答