【发布时间】:2019-09-15 10:15:08
【问题描述】:
我尝试使用vuejs 3 构建一个示例electron 应用程序。我在 Debian Buster 上,运行 node 版本 v10.15.1。
我或多或少地遵循了https://github.com/nklayman/vue-cli-plugin-electron-builder中给出的描述:
vue --version
3.6.3
vue create frontend
cd frontend/
npm run serve //everything is fine
vue add electron-builder
npx vue-cli-service electron:serve
dist_electron/index.js编译成功,但是在INFO Launching Electron...消息之后,什么都没有发生。
也许我认为我的electron 安装坏了:
./node_modules/electron/dist/electron --version
[29769:0426/003034.548566:FATAL:setuid_sandbox_host.cc(157)] 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 /home/info/frontend/node_modules/electron/dist/chrome-sandbox is owned by root and has mode 4755.
按照 Cloud Soh Jun Fu 的建议,我尝试更改权限和所有权:
sudo chown root:root chrome-sandbox
sudo chmod 4755 chrome-sandbox
现在它按预期工作,但不知何故我对此感觉不太好......我的意思是,我只做了一些基本的事情,为此,我希望开箱即用electron......
还有其他建议吗?
【问题讨论】:
-
我按照指南运行
npm run electron:serve,它工作正常。您使用的是什么操作系统?尝试使用ls -al /home/info/frontend/node_modules/electron/dist/chrome-sandbox查看chrome-sandbox的权限。 -
谢谢!我改变了问题。
-
可能与您的用户有关。你运行
npm install时的用户是什么? -
我认为 chrome 是通过
vue add electron-builder安装的,我以普通用户身份运行。此外,/home/info/frontend/node_modules/electron/dist/目录表明它是作为普通用户info安装的。
标签: vue.js electron electron-builder