I have a Node script that calls an external program (PluginManager.exe
) this way:
const util = require('util');
const execFile = util.promisify(require('child_process').execFile);
const process = execFile('PluginManager.exe', ['/install']);
process
.then(({stdout, stderr}) => console.log('done', stdout, stderr))
.catch(e => console.log(e));
PluginManager.exe
takes 8 seconds to execute. My problem is that the Node script keeps running for another 10 more seconds after the child process has exited. I know when PluginManager.exe
finishes because I can see it disappear from the Windows Task Manager Process List.
What keeps the Node process running for so long and what can I do to make sure it exits as soon as the child process exits?
execFile('PluginManager.exe', ['/install'], {shell: true})
and see if it helps? – Cajoleryspawn
helps? https://mcmap.net/q/109102/-exec-display-stdout-quot-live-quot – Cajoleryexe
. Interestingly, it doesn't do it with allexe
s! I'll do more testing to find a pattern and identify which kind of exe cause that. Thanks for your comment. – Mulcahy