Repository navigation
Cannot attach to second node process by using SIGUSR1 #18639
Copy link
Copy link
Closed
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.inspectorIssues and PRs related to the V8 inspector protocol.Issues and PRs related to the V8 inspector protocol.
Description
Activity
- addeddocIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.inspectorIssues and PRs related to the V8 inspector protocol.Issues and PRs related to the V8 inspector protocol.
on Feb 9, 2018 Start node with
--inspect-port=0to bind to a random port or setprocess.debugPortto the desired port number.process.debugPortshould be documented. I've added labels. Could use a note indoc/api/process.mdanddoc/api/debugger.md.can i take this up @bnoordhuis ?
It would be my first contributionThis is about already running processes, so I don't think
--inspect-port=0orprocess.debugPortare valid options, right? How configure that port once the process is already running?As long as the inspector hasn't been started yet, you can configure the port with
process.debugPort.- added 2 commits that reference this issue
on Feb 26, 2018 - added a commit that references this issue
on May 8, 2018 - added a commit that references this issue
on Aug 17, 2018 - added a commit that references this issue
on Sep 6, 2018 - added a commit that references this issue
on May 5, 2024 - added a commit that references this issue
on Jul 27, 2026
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.inspectorIssues and PRs related to the V8 inspector protocol.Issues and PRs related to the V8 inspector protocol.
Suppose I have two or more running node processes which are not in debugging mode and I want to activate the debugger in these processes. By using SIGUSR1 or
process._debugProcess()the process starts listening on the default port 5858 for the debugging client. All node processes after the first that receive SIGUSR1 will fail to take port 5858 and thus cannot be debugged while already running.Worse, if you use
node debug -p $PID_OF_SECOND_PROCESSthe debugger will attach to the first node process that was able to take port 5858 instead of the PID given on the command-line.Is there any way to change the default debugging port for an already running node process, so I can attach to that?