1

我正在尝试通过 Windows 上的 Linux(使用新的内置 Windows bash 功能)在我的 Windows 10 机器上运行电子锻造应用程序。

运行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.

通过一些搜索,电子 Github 上的这个线程非常清楚地表明这在某种程度上是设计使然,解决它的方法是在安装所有依赖项后以 root 用户身份运行 chmod。

我尝试执行此操作,并且该命令看起来有效(将 chmod 运行到 4755 时没有错误),但这并没有解决运行问题electron-forge start- 我仍然收到相同的错误消息。我调查了一下,似乎这与允许 linux 子系统控制每个Microsoft 线程的权限的文件有关。

让电子锻造在 Windows 上与 bash 一起工作还有其他技巧吗?

4

1 回答 1

0

我发现electron-forge init从 Windows PowerShell 运行到本机 Windows 目录允许我随后npm startmy-appWSL 中使用(例如)。所以最终我跑的是

powershell npx create-electron-app my-app

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

于 2020-01-18T08:58:20.253 回答