-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Closed
Labels
child_processIssues and PRs related to the child_process subsystem.Issues and PRs related to the child_process subsystem.
Description
- Version:
10.2.0/11.12.0
- Platform:
Darwin localhost 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
- Details:
Suppose we have following test script and file notexe
exist in the same folder. But notexe
has no executable permission.
const spawn = require('child_process').spawn;
const path = require('path');
function test(name) {
console.log('===', name);
try {
const child = spawn(name);
console.log('spawn.returned - child.stdin', !!child.stdin);
} catch (e) {
console.log('spawn.error', e.message);
}
}
// always spawn with child.stdin equals true, and crash with ENOENT
test('notexe'); // can't find in PATH
test('/notexe'); // can't find in root folder
// in Node 8.9.0, spawn throws EACCES and no crash
// in Node 10.2.0/11.12.0, spawn throws no error with child.stdin equals false, and crash
test('./notexe');
test(path.resolve(__dirname, './notexe'));
So, why did Node 10+ change spawn behaviors? On purpose or regressions?
sindresorhus and e111077
Metadata
Metadata
Assignees
Labels
child_processIssues and PRs related to the child_process subsystem.Issues and PRs related to the child_process subsystem.