gpt4 book ai didi

node.js - 无法在Win10 Ubuntu子系统上运行 Electron

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

我有一个 Electron 项目的仓库,可以在ubuntu子系统中运行,但是现在还可以在新PC上运行,遇到了麻烦。我已经运行了npm我,但是当我运行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重新开始,并得到:
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我重新安装,运行apt-get更新,全局安装 Electron ,但仍然得到这个错误

最佳答案

您需要在DrvF上启用元数据。把它放在/etc/wsl.conf中:

[automount]
options = "metadata"
在此之后,chmod/chown应该可以在Windows文件上运行。有关更多详细信息,请参见此 Microsoft blogpost

关于node.js - 无法在Win10 Ubuntu子系统上运行 Electron ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63784533/

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