-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Closed
Labels
child_processIssues and PRs related to the child_process subsystem.Issues and PRs related to the child_process subsystem.docIssues and PRs related to the documentations.Issues and PRs related to the documentations.
Description
Using child_process.spawn, I believe the docs are incorrect (simple typo with drastic consequences) when using the stdio option:
const cp = require('child_process');
const n = cp.spawn('node',['foo.js'],{
stdio: ['ignore','ignore','ignore'],
detached: true
});
the above should be correct, if you wish to create a child_process that is the leader of a new process group, that won't die if the parent is killed.
However, the child_process docs have this:
https://nodejs.org/api/child_process.html#child_process_options_detached
const n = cp.spawn('node',['foo.js'],{
stdio: ['ignore'],
detached: true
});
I don't believe the above is correct, although this may work:
const n = cp.spawn('node',['foo.js'],{
stdio: 'ignore',
detached: true
});
this issue had me stuck for a few days :)
Metadata
Metadata
Assignees
Labels
child_processIssues and PRs related to the child_process subsystem.Issues and PRs related to the child_process subsystem.docIssues and PRs related to the documentations.Issues and PRs related to the documentations.