javascript - 在 Node.js 中将文件作为分离进程执行
问题描述
我需要在 node.js 的独立进程中执行一个文件。
这是exe文件的路径:
C:\Users\filip\AppData\Roaming/SoulnetworkLauncher/SNLauncherUpdate.exe
我已经尝试过使用 child_process.spawn 但它没有启动(没有触发错误)
const child = cp.spawn("cmd.exe",["C:\Users\filip\AppData\Roaming/SoulnetworkLauncher/SNLauncherUpdate.exe"], {
detached: true,
stdio: ['ignore']
});
child.unref();
并使用 child_process.execFile 但它触发Error: spawn EBUSY
cp.execFile("C:\Users\filip\AppData\Roaming/SoulnetworkLauncher/SNLauncherUpdate.exe")
我应该怎么做?
解决方案
推荐阅读
- android - Kotlin - 截取视图时的奇怪行为
- sre - 在 SRE 上下文中,page 和 pager 是什么意思?
- python - 识别数据集中的错误
- amazon-web-services - 如何在 AWS 中运行计划作业?
- woocommerce - WooCommerce 自定义结帐字段问题
- sql - 在雪花中创建一个数组
- c++ - C++ 从 std::string 数组创建 std::vector
- flutter - 如何根据单元格内容显示具有扩展宽度和高度的 Table / DataTable?(如 HTML 表格行为)
- django - Djoser 在电子邮件中使用不同的域
- sql - 使用有序子字符串连接表