You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a c++ program can run corrcetly by cmd.But when we call this in node spawn with code 3221225477.
Is it some incompatibility issue between Windows 10 platform and Node? I have seen similar situations in other blogs, but my code can run normally on another computer, including launching the service through Node.
Node.js Version
18.20.1
NPM Version
10.5.0
Operating System
win10
Subsystem
child_process
Description
a c++ program can run corrcetly by cmd.But when we call this in node spawn with code 3221225477.
Is it some incompatibility issue between Windows 10 platform and Node? I have seen similar situations in other blogs, but my code can run normally on another computer, including launching the service through Node.
Minimal Reproduction
const { spawn } = require('child_process');
const cppProcess = spawn('./myProgram.exe');
cppProcess.stdout.on('data', (data) => {
console.log(
stdout: ${data}
);});
cppProcess.stderr.on('data', (data) => {
console.error(
stderr: ${data}
);});
cppProcess.on('close', (code) => {
if (code !== 0) {
console.error(
C++ 程序发生错误,退出码 ${code}
);} else {
console.log('C++ 程序正常退出');
}
});
cppProcess.on('error', (err) => {
console.error(
启动 C++ 程序时出错: ${err.message}
);});
Output
No response
Before You Submit
The text was updated successfully, but these errors were encountered: