简体   繁体   English

我无法让 Electron 在 Electron 中运行以在 WSL2 Ubuntu 20.04 中运行

[英]I have not been able to get Electron running within Electron to run in WSL2 Ubuntu 20.04

I have been trying to get electron up and running on WSL2 Ubuntu 20.04 and have been mostly unsuccessful.我一直在尝试让 electron 在 WSL2 Ubuntu 20.04 上运行,但大多没有成功。

(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 (我的用户文件路径,然后) /node_modules/electron/dist/electron退出并带有信号 SIGTRAP

My node version is 16.13.0 and npm is 8.3.0我的节点版本是 16.13.0 和 npm 是 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.具有相同的 WSL、节点和 npm 版本,我遇到了完全相同的问题。

The solution for me was to install using npm install --platform=win32 as mentioned in this thread Trouble starting electron in WSL对我来说,解决方案是使用npm install --platform=win32 ,如该线程中所述麻烦在 WSL 中启动 electron

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM