如何解决启动Electron应用程序时出现问题-[603:0827 / 215406.435140:FATAL:electron_main_delegate.cc264]不支持以root用户身份运行而没有--no-sandbox
我正在尝试建立一个电子项目。我关注了this tutorial和之前的内容。
但是当我进入“运行您的应用”并输入npm start
时,会收到以下消息:
myApp@1.0.0 start ***PATH***
electron .
[603:0827/215406.435140:FATAL:electron_main_delegate.cc(264)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
***PATH***/node_modules/electron/dist/electron exited with signal SIGTRAP
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myApp@1.0.0 start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myApp@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/tobias/.npm/_logs/2020-08-27T11_54_06_541Z-debug.log
npm版本:6.14.6
node.js版本:12.18.3
我在Visual Studio代码中使用WSL终端。
我尝试安装具有相同结果的电子快速入门软件包。
解决方法
我不知道是否有帮助,但是在您的package.json中,尝试将启动脚本更改为
"start": "electron --no-sandbox ."
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。