Heroku Node.JS错误 [英] Heroku Node.JS errors

查看:124
本文介绍了Heroku Node.JS错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Heroku gives me this error, after I deploy the node.js app of mine. Do you have any idea what is error message means? Thank you!

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

推荐答案

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

Try checking your /app/routes.js file, there will be a route that doesn't have two parameters. Try commenting out around lines 23.

或者未正确定义,但是此问题与Heroku无关,当您在本地启动节点app.js时,应该抛出一个错误<耸>耸肩

Or isn't being defined properly, but this issue shouldn't be related to Heroku, and it should throw an error when you boot node app.js locally shrug

希望您能够对它进行排序!

Hope you managed to sort it!

这篇关于Heroku Node.JS错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆