const path = require('path');
const childProcess = require('child_process');
let gulpBinPath = path.resolve(path.join(__dirname, './node_modules/gulp-cli/bin/gulp.js'));
let mainWindow = new BrowserWindow({
width: 800,
height: 600,
titleBarStyle: 'hidden'
});
mainWindow.webContents.on('did-finish-load', function () {
let child = childProcess.spawn(gulpBinPath, ['-v']);
child.stdout.on('data', function(data){
mainWindow.webContents.send('cb', data);
});
});
我想运行gulp -v
,但它会抛出错误:
Error: spawn /Users/user/Desktop/electron-test/electron-test-darwin-x64/electron-test.app/Contents/Resources/app/node_modules/gulp-cli/bin/gulp ENOENT
。
我不知道如何解决它,我可以搜索的所有答案都不是解决这个问题。请帮帮我。
抱歉,我的英语非常差,感谢您的阅读。