【发布时间】:2017-01-26 23:18:39
【问题描述】:
在将 Node 应用程序部署到 Heroku 时,我收到以下错误消息。任何想法可能导致它?
- 2016-09-19T09:44:06.497018+00:00 app[web.1]: "stack": [
- 2016-09-19T09:44:06.497020+00:00 app[web.1]:“TypeError: options.mongooseConnection.once 不是函数”,
- 2016-09-19T09:44:06.497021+00:00 app[web.1]:“在 MongoStore (/app/node_modules/connect-mongo/src/index.js:91:48)”,李>
- 2016-09-19T09:44:06.497021+00:00 app[web.1]:“在 Object.(/app/app/session/index.js:14:17)”,
- 2016-09-19T09:44:06.497022+00:00 app[web.1]:“在 Module._compile (module.js:413:34)”,
- 2016-09-19T09:44:06.497022+00:00 app[web.1]:“在 Object.Module._extensions..js (module.js:422:10)”,
- 2016-09-19T09:44:06.497023+00:00 app[web.1]:“在 Module.load (module.js:357:32)”,
- 2016-09-19T09:44:06.497023+00:00 app[web.1]:“在 Function.Module._load (module.js:314:12)”,
- 2016-09-19T09:44:06.497024+00:00 app[web.1]:“在 Module.require (module.js:367:17)”,
- 2016-09-19T09:44:06.497024+00:00 app[web.1]: "at require (internal/module.js:20:19)",
- 2016-09-19T09:44:06.497025+00:00 app[web.1]:“在 Object.(/app/app/index.js:16:15)”,
- 2016-09-19T09:44:06.497025+00:00 app[web.1]:“在 Module._compile (module.js:413:34)”,
- 2016-09-19T09:44:06.497026+00:00 app[web.1]:“在 Object.Module._extensions..js (module.js:422:10)”,
- 2016-09-19T09:44:06.497027+00:00 app[web.1]: "在 Module.load (module.js:357:32)",
- 2016-09-19T09:44:06.497027+00:00 app[web.1]:“在 Function.Module._load (module.js:314:12)”,
- 2016-09-19T09:44:06.497028+00:00 app[web.1]:“在 Module.require (module.js:367:17)”,
- 2016-09-19T09:44:06.497028+00:00 app[web.1]: "at require (internal/module.js:20:19)",
- 2016-09-19T09:44:06.497029+00:00 app[web.1]:“在 Object.(/app/server.js:4:17)”,
- 2016-09-19T09:44:06.497029+00:00 app[web.1]: "在 Module._compile (module.js:413:34)",
- 2016-09-19T09:44:06.497030+00:00 app[web.1]:“在 Object.Module._extensions..js (module.js:422:10)”,
- 2016-09-19T09:44:06.497030+00:00 app[web.1]:“在 Module.load (module.js:357:32)”,
- 2016-09-19T09:44:06.497031+00:00 app[web.1]:“在 Function.Module._load (module.js:314:12)”,
- 2016-09-19T09:44:06.497032+00:00 app[web.1]: "在 Function.Module.runMain (module.js:447:10)",
- 2016-09-19T09:44:06.497032+00:00 app[web.1]:“启动时 (node.js:148:18)”
- 2016-09-19T09:44:06.497033+00:00 应用[web.1]: ],
- 2016-09-19T09:44:06.497033+00:00 app[web.1]: "level": "error",
- 2016-09-19T09:44:06.497034+00:00 app[web.1]: "message": "uncaughtException: options.mongooseConnection.once 不是函数"
- 2016-09-19T09:44:06.497035+00:00 应用[web.1]: }
【问题讨论】:
-
你能把你的
mongoose连接代码吗?
标签: node.js mongodb heroku mongoose