简体   繁体   English

在Heroku上交互式调试Node.js应用程序?

[英]Interactively debugging a Node.js application on Heroku?

My Node.js application runs correctly locally but it has errors once deployed to Heroku. 我的Node.js应用程序在本地正确运行,但是一旦部署到Heroku,就会出错。

I cannot use node-inspector to debug as it requires three ports, and Heroku allows only one port. 我无法使用node-inspector进行调试,因为它需要三个端口,而Heroku仅允许一个端口。

https://discussion.heroku.com/t/how-to-debug-node-on-heroku-using-something-like-node-inspector/477/6 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. 我无法使用Node.js内置的调试器,因为我需要CLI才能发出调试命令。

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

What is the best strategy for interactively debugging a Node.js application on Heroku? 在Heroku上交互式调试Node.js应用程序的最佳策略是什么?

Found One-Off Dynos, which allow: 发现了一次性Dynos,它可以:

Running a console (also known as a REPL shell) to run arbitrary code or inspect the app's models against the live database. 运行控制台(也称为REPL Shell)以运行任意代码或针对实时数据库检查应用程序的模型。 (eg rails console, irb, or node) (例如,rails控制台,irb或节点)

https://devcenter.heroku.com/articles/one-off-dynos#types-of-one-off-dynos 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. 我没有时间进行测试,但是这应该可以让我运行内置的节点调试器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM