简体   繁体   English

无法在 win10 ubuntu 子系统上运行电子

[英]cant run electron on win10 ubuntu subsystem

i have a repo for an electron project ive been able to run in ubuntu subsystem before fine, im on a new pc now and having trouble.我有一个电子项目的回购,我之前可以在 ubuntu 子系统中运行,现在我在一台新电脑上遇到了问题。 I already ran npm i, but when I run electron .我已经运行 npm i,但是当我运行electron . i get this err:我得到这个错误:

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.

so i ran所以我跑了

sudo chown root /mnt/c/Users/marti/Documents/projects/electron-upload-manager/node_modules/electron/dist/chrome-sandbox

and

sudo chmod 4755 /mnt/c/Users/marti/Documents/projects/electron-upload-manager/node_modules/electron/dist/chrome-sandbox

then ran npm start again, and get:然后再次运行 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.

I did what the error asked, but still got the error?我做了错误要求的操作,但仍然出现错误? Ive tried removing my node_modules, reinstalling with npm i, running apt-get update, installing electron globally but still am getting this err我试过删除我的 node_modules,用 npm i 重新安装,运行 apt-get update,全局安装电子,但仍然出现这个错误

You need to enable metadata on DrvFs.您需要在 DrvF 上启用元数据。 Put this in /etc/wsl.conf :把它放在/etc/wsl.conf

[automount]
options = "metadata"

After this, chmod/chown should work on windows files.在此之后, chmod/chown 应该可以处理 Windows 文件。 See this Microsoft blogpost for more details.有关更多详细信息,请参阅此Microsoft 博文

我只是在命令提示符下运行它,让它在那里工作正常

Try this command.试试这个命令。 It is a work-around:这是一种解决方法:

sudo sysctl kernel.unprivileged_userns_clone=1

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

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