gpt4 book ai didi

node.js - 运行electron app报错 'the futex facility returned an unexpected error'

转载 作者:行者123 更新时间:2023-12-04 18:25:58 24 4
gpt4 key购买 nike

我正在尝试启动任何 Electron 应用程序。当我尝试使用 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 代码

最佳答案

我最近在尝试使用 WSL2 运行我的 Electron 应用程序时遇到了这个问题。
所需元素汇总:

  • XSERV 在 Windows 上运行以运行 Linux GUI 应用程序(例如,您的 Electron 应用程序)
  • 从远程 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

    关于node.js - 运行electron app报错 'the futex facility returned an unexpected error',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65407358/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com