我有一个电子项目的回购,我之前可以在 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,全局安装电子,但仍然出现此错误