gpt4 book ai didi

windows - 在Windows上的Linux上运行Electron

转载 作者:行者123 更新时间:2023-12-03 12:28:16 25 4
gpt4 key购买 nike

我试图通过Windows上的Linux(使用新的内置Windows Bash功能)在Windows 10机器上运行 Electron 伪造应用程序。

运行electron-forge start时,我得到了错误消息:

[1484:1126/222326.466455:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /mnt/c/.../node_modules/electron/dist/chrome-sandbox is owned by root and has mode 4755.

通过一些搜索,此 thread on the electron Github可以很清楚地看出这是设计使然,而解决该问题的方法是在安装所有依赖项后以root用户身份运行chmod。

我尝试执行此操作,命令看起来像是已经工作了(将chmod运行到4755时没有错误),但这并不能解决 electron-forge start的运行问题-我仍然收到相同的错误消息。我仔细研究了一下,似乎这与linux子系统允许控制每个 this Microsoft thread权限的文件有关。

还有其他一些技巧可以使 Electron 锻造在Windows上与bash一起使用吗?

最佳答案

我发现从Windows powershell将electron-forge init运行到 native Windows目录中后,我随后可以在WSL中的npm start中使用my-app(例如)。所以最终我跑的是

powershell npx create-electron-app my-app

(我的.bashrc文件中有 alias powershell="/mnt/c/windows/system32/WindowsPowerShell/v1.0/powershell.exe")

关于windows - 在Windows上的Linux上运行Electron,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59064749/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com