【问题标题】:Running electron app get an error 'the futex facility returned an unexpected error'运行电子应用程序出现错误“futex 工具返回了意外错误”
【发布时间】:2021-04-01 01:52:14
【问题描述】:

我正在尝试启动任何电子应用程序。当我尝试使用npm start 运行应用程序时,我收到一个错误Running as root without `--no-sandbox` is not supported 我将启动脚本从"electron ." 编辑为"electron --no-sandbox ." 并收到新的错误The futex facility returned an unexpected error code./mnt/c/Users/Oleg/electron-quick-start/node_modules/electron/dist/electron exited with signal SIGABRT。我在谷歌上找不到这个问题的答案,请大家帮忙。 我的环境是:Windows 10 2004, Ubuntu 18.04 LTS、Node.js 12、Visual Studio 代码

【问题讨论】:

标签: node.js ubuntu electron ubuntu-18.04 environment


【解决方案1】:

我最近在尝试使用 WSL2 运行我的 Electron 应用程序时遇到了这个问题。

所需物品汇总:

  • XSERV 在 Windows 上运行以运行 Linux GUI 应用程序(例如,您的电子应用程序)
  • 从远程 WSL 子系统正确识别 DISPLAY

获取 XSERVER

我使用https://sourceforge.net/projects/vcxsrv/。下载并安装。

确保正确识别您的显示器

从您的 WSL 终端运行

export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0

授权问题?

Authorization required, but no authorization protocol specified

查看下面的 GitHub 问题,以进一步了解为您的 XSERVER 创建启动脚本以解决您的授权问题。

https://github.com/microsoft/WSL/issues/4793#issuecomment-588321333

注意:我没有必须执行才能使我的设置正常工作。上面的 DISPLAY 命令正确识别了我的主机,所以这个是不必要的:

export DISPLAY=$WSL_IF_IP:0

【讨论】:

  • 谢谢!并且(自我注意)确保您的 x-server 在任何重新启动后再次启动:)
猜你喜欢
  • 2017-08-19
  • 2018-07-20
  • 2021-11-20
  • 1970-01-01
  • 2022-01-21
  • 2020-05-31
  • 1970-01-01
  • 2020-03-03
  • 2018-03-26
相关资源
最近更新 更多