-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed
Labels
child_processIssues and PRs related to the child_process subsystem.Issues and PRs related to the child_process subsystem.libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Description
- Version: v6.5.0
- Platform: Windows 10 (x64)
- Subsystem: child_process
let cp = require('child_process');
let util = require('util');
try {
cp.execFileSync('SomeTool.exe')
} catch (err) {
console.log('err', util.inspect(err));
}
outputs
err { Error: spawnSync SomeTool.exe UNKNOWN
at exports._errnoException (util.js:1026:11)
at spawnSync (child_process.js:461:20)
at Object.execFileSync (child_process.js:498:13)
at repl:2:4
at sigintHandlersWrap (vm.js:22:35)
at sigintHandlersWrap (vm.js:96:12)
at ContextifyScript.Script.runInThisContext (vm.js:21:12)
at REPLServer.defaultEval (repl.js:313:29)
at bound (domain.js:280:14)
at REPLServer.runBound [as eval] (domain.js:293:12)
code: 'UNKNOWN',
errno: 'UNKNOWN',
...
}
spawn generates the same error.
Obviously it would be better if this error was returned through the callback but I would also love to have a proper error code to react to the situation.
Not sure how execFile and spawn are implemented but it should be possible to report a proper errorcode as CreateProcess generates errorcode 740 if elevation is required.
Metadata
Metadata
Assignees
Labels
child_processIssues and PRs related to the child_process subsystem.Issues and PRs related to the child_process subsystem.libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.