You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
is there some way to debug a process ignoring child processes that tries to connect to the debugger? #649
i'm trying to debug my node.js application (using --inspect), the application uses some third-party modules that make use of the child_process module internally.
when i try to debug my app and when some part of the code reach other part that uses child_process a message like this is printed Starting inspector on 0.0.0.0:9229 failed: address already in use and the child process exits with an exit code of 12 (which is documented in docs), what i understand is that all nodejs child processes by default tries to connect to the inspector on the same port (9229 by default), however i'm trying to find a way to tell node that all child processes should not try to connect to the inspector, i'm only interested in debugging all the code that is running in the same process, this is something that was possible using the now deprecated node-inspector package, with node-inspector all code can work normally because child processes does not try to connect to the debugging session, which makes debugging all the code in the main process possible.
is there something i can do to achieve this? it is really annoying that the application does not work correctly in debugging mode for this reason. thanks!
changed the title [-]is there some way to debug a process ignoring child processes that tries to connect the debugger?[/-][+]is there some way to debug a process ignoring child processes that tries to connect to the debugger?[/+]on May 31, 2017
thnks for answering! and yes i think that at least it will let the application to run normally without exits of child processes.
just one concern, in the theorical case that some package that uses a child process gets published with a debugger; statement inside of it, does it will block the execution if i don't have for example a chrome debug session opened (the inspector opened in a chrome tab)?
No, debugger is a no-op unless there is a debug client attached (e.g DevTools or VS Code) attached.
In fact, if you wanted the option to break at an early debugger statement, you'd start node with --inspect-brk=<port> to give the debug client time to attach.
Activity
[-]is there some way to debug a process ignoring child processes that tries to connect the debugger?[/-][+]is there some way to debug a process ignoring child processes that tries to connect to the debugger?[/+]bnoordhuis commentedon May 31, 2017
Node.js v8.1.0 will let each process bind to a separate random port with
--inspect=0. Would that help?bjrmatos commentedon May 31, 2017
thnks for answering! and yes i think that at least it will let the application to run normally without exits of child processes.
just one concern, in the theorical case that some package that uses a child process gets published with a
debugger;statement inside of it, does it will block the execution if i don't have for example a chrome debug session opened (the inspector opened in a chrome tab)?bnoordhuis commentedon May 31, 2017
No,
debuggeris a no-op unless there is a debug client attached (e.g DevTools or VS Code) attached.In fact, if you wanted the option to break at an early
debuggerstatement, you'd start node with--inspect-brk=<port>to give the debug client time to attach.bjrmatos commentedon May 31, 2017
clear now, looking forward for random ports thnk you!