0

在我部署了我的 node.js 应用程序之后,Heroku 给了我这个错误。你知道错误信息是什么意思吗?谢谢!

2013-01-14T22:50:34+00:00 heroku[web.1]: State changed from crashed to starting
2013-01-14T22:50:36+00:00 heroku[web.1]: Starting process with command `node app.js`
2013-01-14T22:50:37+00:00 app[web.1]: 
2013-01-14T22:50:37+00:00 app[web.1]: /app/node_modules/express/lib/router/index.js:252
2013-01-14T22:50:37+00:00 app[web.1]:     throw new Error(msg);
2013-01-14T22:50:37+00:00 app[web.1]:           ^
2013-01-14T22:50:37+00:00 app[web.1]: Error: .get() requires callback functions but got a [object Undefined]
2013-01-14T22:50:37+00:00 app[web.1]:     at Router.route.Route.sensitive (/app/node_modules/express/lib/router/index.js:252:11)
2013-01-14T22:50:37+00:00 app[web.1]:     at Array.forEach (native)
2013-01-14T22:50:37+00:00 app[web.1]:     at Router.route (/app/node_modules/express/lib/router/index.js:248:13)
2013-01-14T22:50:37+00:00 app[web.1]:     at Router.methods.forEach.Router.(anonymous function) [as get] (/app/node_modules/express/lib/router/index.js:270:16)
2013-01-14T22:50:37+00:00 app[web.1]:     at Function.methods.forEach.app.(anonymous function) [as get] (/app/node_modules/express/lib/application.js:411:26)
2013-01-14T22:50:37+00:00 app[web.1]:     at Routes.self.init (/app/routes.js:23:9)
2013-01-14T22:50:37+00:00 app[web.1]:     at Object.<anonymous> (/app/app.js:42:8)
2013-01-14T22:50:37+00:00 app[web.1]:     at Module._compile (module.js:449:26)
2013-01-14T22:50:37+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:467:10)
2013-01-14T22:50:37+00:00 app[web.1]:     at Module.load (module.js:356:32)
2013-01-14T22:50:38+00:00 heroku[web.1]: State changed from starting to crashed
2013-01-14T22:50:38+00:00 heroku[web.1]: Process exited with status 1
4

2 回答 2

1

尝试检查您的 /app/routes.js 文件,会有一个没有两个参数的路由。尝试在第 23 行注释掉。

或者没有正确定义,但是这个问题不应该与 Heroku 相关,当你在本地启动 node app.js 时它应该会抛出一个错误耸耸肩

希望您设法对其进行排序!

于 2013-01-23T13:11:37.107 回答
0

似乎这是您的应用程序的问题,而不是与 Heroku 相关的问题。

您应该尝试在本地运行该项目,并找出问题所在。

检查你的 `app/routes.js' 文件。

于 2013-04-21T11:13:35.013 回答