I have been trying to get electron up and running on WSL2 Ubuntu 20.04 and have been mostly unsuccessful.
(Error below from terminal)
nicholaos_sofocleous@DESKTOP-8U1KGF4:~/OSP/Kafmira$ npm run start
kafmira@1.0.0 start
electron.
(my user file path and then) /node_modules/electron/dist/electron
exited with signal SIGTRAP
My node version is 16.13.0 and npm is 8.3.0
"scripts": {
"start": "electron .",
"watch": "webpack --config webpack.config.js --watch",
"pack": "electron-builder -mwl"
},
(dependencies for electron in .json:)
"electron": "^16.0.4",
"electron-devtools-installer": "^3.2.0",
"electron-is-dev": "^2.0.0",
"electron-reload": "^2.0.0-alpha.1",
(dev dependencies for electron in .json:)
"electron-builder": "^22.14.5"
This is a great question, hope you get this sorted
Having identical WSL, node & npm version, I encountered exactly the same issue.
The solution for me was to install using npm install --platform=win32
as mentioned in this thread Trouble starting electron in WSL
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.