I'm trying to launch mupen64plus from Node.js like so:

var exec = require('child_process').execFile;

var child = exec('mupen64plus.exe --fullscreen "../roms/some-homebrew.z64"', function(err, stdout, stderr) {
  console.log(err, stdout, stderr);
});

Which give the output of:

{ [Error: spawn ENOENT] code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn' } '' ''

I know it is running the application, because when I remove the "../roms/some-homebrew.z64" section, I get the regular mupen64plus output saying it cannot find a ROM to load.

I assume the error has to do with spawning a new window, or application, to actually run this.

Am I doing the right thing to spawn this application? If so, how can I get further information on what's happening?

Update: This code works!

var exec = require('child_process').spawn;

var child = exec(__dirname + '/relative-path/to/mupen64plus.exe', ['--fullscreen', __dirname + '/relative-path/to/home-brew.z64']);
有帮助吗?

解决方案

Remove the double quotes around the ROM path. Given the description you've given about the troubleshooting you've done, the issue looks to be with the format you're passing the argument in.

There shouldn't be any issues with opening a fullscreen application and there are various examples that utilise exec to open fullscreen chrome windows.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top