Heroku Node.JS errors

痞子三分冷 提交于 2019-12-25 09:56:27

问题


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

回答1:


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

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!




回答2:


Seems that's your app's problem and not a issue related to Heroku.

You should try to running the project locally, and figure out the problems.

Check your `app/routes.js' file.



来源:https://stackoverflow.com/questions/14328286/heroku-node-js-errors

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!