在Heroku上交互调试Node.js应用程序? [英] Interactively debugging a Node.js application on Heroku?

查看:298
本文介绍了在Heroku上交互调试Node.js应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Node.js应用程序在本地运行正常,但是一旦部署到Heroku,它就会出现错误。



我不能使用node-inspector进行调试,因为它需要三个端口, Heroku只允许一个端口。



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



我不能使用Node.js内置的调试器,因为我需要一个CLI来发出调试命令。

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



在Heroku上交互调试Node.js应用程序的最佳策略是什么? / strong>

解决方案

找到一次性Dynos,允许:



< blockquote>

Runn使用控制台(也称为REPL shell)运行任意代码或根据实时数据库检查应用程序的模型。 (例如rails console,irb或node)


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



我没有时间测试,但这应该让我运行内置的节点调试器。


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?

解决方案

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.

这篇关于在Heroku上交互调试Node.js应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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