electron 报错 gpu_process_host.cc | GPU process launch failed: error_code=xx

219 阅读1分钟

最近由于换了电脑在新电脑上启动electron发现这个问题于记录解决方案

方案一:开启电脑gpu加速

  1. 进入显示设置,屏幕选择图形设置
  2. 开启GPU加速计划

image.png

方案二:在mainjs加禁用谷歌内核沙箱(可能会降低安全性)

app.commandLine.appendSwitch('no-sandbox');