Answer the question
In order to leave comments, you need to log in
Why is child_process electron not working?
Hello!
My application sends me a message that I wrote in a text field.
Without assembly, the program works well. But when I collect it via electron-packager no messages are sent.
const { app, BrowserWindow, ipcMain } = require('electron');
const child_process = require('child_process');
ipcMain.on('begin', (e, ...args) => {
let child = child_process.fork('easyvk.js');
child.send(args);
});
Answer the question
In order to leave comments, you need to log in
Most likely a problem with the paths for 'easyvk.js'
.
First, it's best to always calculate the absolute path to the file.
Secondly, electron-packager packs the application into asar, and if require is patched to work with it, then child_process most likely does not exist and the file needs to be unpacked before launch.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question