Skip to content

Can't send signals using signal numbers #18553

@hinzundcode

Description

@hinzundcode

Using process.kill with signal numbers should work according to the documentation, but I get an ERR_UNKNOWN_SIGNAL error when using numbers instead of strings. For example:

$ node
> process.kill(process.pid, "SIGTERM")
Terminated

$ node
> 15 === require("constants").SIGTERM
true
> process.kill(process.pid, 15)
TypeError [ERR_UNKNOWN_SIGNAL]: Unknown signal: 15
    at process.kill (internal/process.js:168:15)

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.processIssues and PRs related to the process subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions