在Node.js中将文件作为分离过程执行

时间:2018-08-24 12:25:19

标签: 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")

我应该怎么办?

0 个答案:

没有答案