My code is very simple:
const { Worker } = require('worker_threads');
let script = `console.log('working...');`;
new Worker(script, { eval: true });
I can see working...
output in the console, but when I exit the program with command+q
, I see an exception in the console: my-electron-app/node_modules/_electron@11.3.0@electron/dist/Electron.app/Contents/MacOS/Electron exited with signal SIGSEGV
When I run with sudo npm start
, I also see a popup about Electron quit unexpectedly
git clone https://github.com/Vict0r-Chen/electron-worker-threads.git
npm install
npm start
| sudo npm start
According to this information, using npm install electron 12.0.0@beta --save-dev
to upgrade electron to v12.0.0
can solve this problem.