Attach debugger to a node process
Hello
How do I attach the debugger to a running process? When I run my node application via the Terminal, in the output there is this line:
Debugger listening on ws://127.0.0.1:9229/2ba959e1-aad3-4fee-a0d0-3f341ffcc20c
I want to continue to run my application via the Terminal, and when I want to debug, I want to fire up IntelliJ and debug through IntelliJ.
How do I attach the debugger to the above?
Thanks
Please sign in to leave a comment.
Create a run configuration of type Attach to Node.js/Chrome, with port matching the port you pass to your app with
--inspect(9229 in your case) and hit Debug. You don't even need doing this manually, just hold Ctrl+Shift and click the link. See Running and debugging Node.js | IntelliJ IDEA (jetbrains.com)