【发布时间】:2020-12-21 19:00:24
【问题描述】:
我有一个电子项目的 repo,我之前可以在 ubuntu 子系统中运行,我现在在一台新电脑上并且遇到了问题。我已经运行了 npm i,但是当我运行 electron . 时,我得到了这个错误:
martin@DESKTOP-URPCCBK:/mnt/c/Users/marti/Documents/projects/electron-upload-manager$ npm start
> drag-and-drop@1.0.0 start /mnt/c/Users/marti/Documents/projects/electron-upload-manager
> electron .
[5094:0907/143024.016724:FATAL:setuid_sandbox_host.cc(158)] 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/Users/marti/Documents/projects/electron-upload-manager/node_modules/electron/dist/chrome-sandbox is owned by root and has mode 4755.
所以我跑了
sudo chown root /mnt/c/Users/marti/Documents/projects/electron-upload-manager/node_modules/electron/dist/chrome-sandbox
和
sudo chmod 4755 /mnt/c/Users/marti/Documents/projects/electron-upload-manager/node_modules/electron/dist/chrome-sandbox
然后再次运行 npm start,得到:
martin@DESKTOP-URPCCBK:/mnt/c/Users/marti/Documents/projects/electron-upload-manager$ npm start
> drag-and-drop@1.0.0 start /mnt/c/Users/marti/Documents/projects/electron-upload-manager
> electron .
[5120:0907/143308.127280:FATAL:setuid_sandbox_host.cc(158)] 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/Users/marti/Documents/projects/electron-upload-manager/node_modules/electron/dist/chrome-sandbox is owned by root and has mode 4755.
我按照错误的要求做了,但仍然得到错误?我尝试删除我的 node_modules,使用 npm i 重新安装,运行 apt-get update,全局安装电子,但仍然出现此错误
【问题讨论】:
-
嗯,你在drvfs上启用文件权限了吗?
-
什么是drvfs?
-
drvfs 是一个文件系统,可以让 wsl/windows 在 windows 文件上进行协作。