问题 This is my script : var exec = require('child_process').exec; exec('dir', function(error, stdout, stderr) { // 'dir' is for example if (error) { console.error(`exec error: ${error}`); return; } console.log(`stdout: ${stdout}`); console.log(`stderr: ${stderr}`); }); And in the console I have : exec error: Error: spawn C:\Windows\system32\cmd.exe; ENOENT Someone can help me ? 回答1: I got to resolve the issue the problem is to remove the semicolon(;) from an end of the ComSpec path C:\Windows