【问题标题】:How to rebuild epoll package in electron?如何在电子中重建 epoll 包?
【发布时间】:2021-12-21 05:59:42
【问题描述】:

我尝试重建一个电子应用程序,但我收到有关 epoll 安装的错误。

Building module: epoll, Completed: 0gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in binding.gyp while trying to load binding.gyp
✖ Rebuild Failed
An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild '/home/pi/ma-0042-cihaz-be/node_modules/epoll'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".
Error: `gyp` failed with exit code: 1
Error: node-gyp failed to rebuild '/home/pi/ma-0042-cihaz-be/node_modules/epoll'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".
at NodeGyp.rebuildModule (/home/pi/ma-0042-cihaz-be/node_modules/electron-rebuild/lib/src/module-type/node-gyp.js:109:19)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async ModuleRebuilder.rebuildNodeGypModule (/home/pi/ma-0042-cihaz-be/node_modules/electron-rebuild/lib/src/module-rebuilder.js:94:9)
    at async Rebuilder.rebuildModuleAt (/home/pi/ma-0042-cihaz-be/node_modules/electron-rebuild/lib/src/rebuild.js:226:9)
    at async Rebuilder.rebuild (/home/pi/ma-0042-cihaz-be/node_modules/electron-rebuild/lib/src/rebuild.js:184:17)
    at async /home/pi/ma-0042-cihaz-be/node_modules/electron-rebuild/lib/src/cli.js:154:9

我正在使用覆盆子,我也更新了它。但它没有用。 这些是安装的依赖项。

{
 
  "dependencies": {
    "@babel/preset-react": "^7.14.5",
    "bcryptjs": "^2.4.3",
    "body-parser": "^1.19.0",
    "cors": "^2.8.5",
    "dotenv": "^10.0.0",
    "express": "^4.17.1",
    "history": "^5.1.0",
    "i2c-bus": "^5.2.2",
    "jest": "^27.3.1",
    "jest-fetch-mock": "^3.0.3",
    "jsonwebtoken": "^8.5.1",
    "mfrc522-rpi": "^2.1.3",
    "moment": "^2.29.1",
    "network-config": "^3.0.0",
    "node-cron": "^3.0.0",
    "node-fetch": "^2.6.5",
    "node-wifi": "^2.0.15",
    "pi-camera": "^1.6.0",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-router-dom": "^6.0.0",
    "realm": "^10.7.0",
    "rpi-gpio": "^2.1.7",
    "rpi-softspi": "^1.0.5",
    "rpio": "^2.4.2",
    "source-map-support": "^0.5.16"
  },
  "devDependencies": {
    "@babel/core": "^7.15.5",
    "@babel/node": "^7.15.4",
    "@babel/plugin-transform-runtime": "^7.16.0",
    "@babel/preset-env": "^7.15.6",
    "babel-loader": "^8.2.2",
    "electron": "8.2.0",
    "electron-builder": "^22.11.7",
    "electron-rebuild": "^3.2.3",
    "electron-webpack": "^2.8.2",
    "enzyme": "^3.11.0",
    "enzyme-adapter-react-16": "^1.15.6",
    "enzyme-to-json": "^3.6.2",
    "webpack": "~4.42.1"
  }
}

我用 package-lock.json 删除了 node_modules 并重新安装了所有东西。我用 apt-get upgrade 更新了覆盆子。我不知道我该如何解决这个问题。你有什么想法吗?

【问题讨论】:

    标签: javascript raspberry-pi node-gyp epoll electron-rebuild


    【解决方案1】:

    在我的例子中,在将 NodeJS 更新到 17.0.1 版本后,同样的问题开始了。

    整个问题出在 bcrypt 包中,它不再符合版本 17 的标准

    在我的情况下,将版本降低到 16 会有所帮助。

    【讨论】:

    • 这对我有帮助,electron-builder 在 nodejs 17 上给了npm ERR! command sh -c node-gyp rebuild,但 16 有效。
    【解决方案2】:

    electron-rebuild v3.2.5 发布。

    更新后问题解决了!

    【讨论】:

    • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
    【解决方案3】:

    我也有同样的问题,但我使用的是串行端口而不是 epoll。

    所以,我认为这个问题的原因是电子模块而不是本机模块。

    yarn run v1.22.15
    $ electron-rebuild -f -w myapp
    \ Building module: bindings, Completed: 0gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in binding.gyp while trying to load binding.gyp
    × Rebuild Failed
    
    An unhandled error occurred inside electron-rebuild
    node-gyp failed to rebuild 'C:\Users\node_modules\@serialport\bindings'.
    For more information, rerun with the DEBUG environment variable set to "electron-rebuild".
    
    Error: `gyp` failed with exit code: 1
    
    
    
    Error: node-gyp failed to rebuild 'C:\Users\node_modules\@serialport\bindings'.
    For more information, rerun with the DEBUG environment variable set to "electron-rebuild".
    
    Error: `gyp` failed with exit code: 1
    
    
        at NodeGyp.rebuildModule (C:\Users\node_modules\electron-rebuild\lib\src\module-type\node-gyp.js:109:19)
        at processTicksAndRejections (internal/process/task_queues.js:95:5)
        at async ModuleRebuilder.rebuildNodeGypModule (C:\Users\node_modules\electron-rebuild\lib\src\module-rebuilder.js:94:9)
        at async Rebuilder.rebuildModuleAt (C:\Users\node_modules\electron-rebuild\lib\src\rebuild.js:226:9)
        at async Rebuilder.rebuild (C:\Users\node_modules\electron-rebuild\lib\src\rebuild.js:184:17)
        at async C:\Users\node_modules\electron-rebuild\lib\src\cli.js:154:9
    error Command failed with exit code 4294967295.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

    这个问题是昨天开始的。上周没有出现任何问题。

    我已经安装了 windows-build-tools、node-gyp、python 3.x。

    我设置了 npm config & yarn config & python Env 路径,msvs_version 也是。

    我多次重新安装上述软件包但无法使用电子重建。

    这是整个错误消息。没有更多错误消息。

    我们应该怎么做?

    【讨论】:

      猜你喜欢
      • 2013-06-13
      • 2017-05-18
      • 2017-12-27
      • 2022-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-11
      • 2019-07-27
      相关资源
      最近更新 更多