Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call exe by node reutrn 3221225477 #4527

Open
2 tasks done
joy-0909 opened this issue Jan 8, 2025 · 0 comments
Open
2 tasks done

call exe by node reutrn 3221225477 #4527

joy-0909 opened this issue Jan 8, 2025 · 0 comments
Labels

Comments

@joy-0909
Copy link

joy-0909 commented Jan 8, 2025

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

  • I have looked for issues that already exist before submitting this
  • My issue follows the guidelines in the README file, and follows the 'How to ask a good question' guide at https://stackoverflow.com/help/how-to-ask
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants