Interactively debugging a Node.js application on Heroku?

余生长醉 提交于 2019-12-07 08:27:07

问题


My Node.js application runs correctly locally but it has errors once deployed to Heroku.

I cannot use node-inspector to debug as it requires three ports, and Heroku allows only one port.

https://discussion.heroku.com/t/how-to-debug-node-on-heroku-using-something-like-node-inspector/477/6

I cant use the debugger built into Node.js because I need a CLI to issue debugging commands.

http://nodejs.org/api/debugger.html#debugger_debugger

What is the best strategy for interactively debugging a Node.js application on Heroku?


回答1:


Found One-Off Dynos, which allow:

Running a console (also known as a REPL shell) to run arbitrary code or inspect the app’s models against the live database. (e.g. rails console, irb, or node)

https://devcenter.heroku.com/articles/one-off-dynos#types-of-one-off-dynos

I didn't have time to test, but this should let me run the built in node debugger.



来源:https://stackoverflow.com/questions/25494402/interactively-debugging-a-node-js-application-on-heroku

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