简体   繁体   中英

Interactively debugging a Node.js application on Heroku?

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. (eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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