How to rebuild epoll package in electron?
Asked Answered
D

5

5

I try to rebuild an electron app but I got this error regarding the epoll installation.

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

I am using a raspberry, I did update it too. But it didn't work. These are the dependencies installed.

{
 
  "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"
  }
}

I deleted node_modules with package-lock.json and installed everything again. I updated the raspberry with apt-get upgrade. I don't know how can I solve this issue. Do you have any ideas?

Dancer answered 8/11, 2021 at 11:26 Comment(0)
A
2

gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in binding.gyp while trying to load binding.gyp

I just spent my day solving this. Eventually, here's what has worked for me.

  • install the latest node-gyp locally:

    npm install -d node-gyp@latest
    
  • in binding.gyp, add (at the top):

    {
        "variables": {
            "openssl_fips" : "0" 
        },
    
        ...      
    }
    
Amie answered 18/3, 2022 at 7:33 Comment(3)
I have this issue with NodeJS 17. Can you please tell where exactly (which binding.gyp) the code above must be added? I tried to add it as described in the binding.gyp of the module that fails, but unfortunately it doesn't help. Thanks!Wilhelmina
@Bernd, I was having this problem with Electron, can't speak of Node. I put that at the very top binding.gyp. You already should have the root opining { and closing } brackets there.Amie
Hacky: For build failures in external packages (gotten from npm install), I went into the node_modules and access the binding.gyp of the faultypackage at fault to append the openssl_fips as shared above. I am remove the build directory in the package directory. Doing npm install again after the change will be successful.Mallee
D
4

In my case, after updating NodeJS to version 17.0.1, the same problems started.

The whole problem was in the bcrypt package, it no longer meets the standards of version 17

In my case, reduced the version to 16 helped.

Dennadennard answered 9/11, 2021 at 10:41 Comment(1)
This helped me, electron-builder was giving npm ERR! command sh -c node-gyp rebuild on nodejs 17, but 16 works.Conto
D
3

electron-rebuild v3.2.5 released.

The problem was solved after updating!

Distillate answered 10/11, 2021 at 5:4 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Chophouse
A
2

gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in binding.gyp while trying to load binding.gyp

I just spent my day solving this. Eventually, here's what has worked for me.

  • install the latest node-gyp locally:

    npm install -d node-gyp@latest
    
  • in binding.gyp, add (at the top):

    {
        "variables": {
            "openssl_fips" : "0" 
        },
    
        ...      
    }
    
Amie answered 18/3, 2022 at 7:33 Comment(3)
I have this issue with NodeJS 17. Can you please tell where exactly (which binding.gyp) the code above must be added? I tried to add it as described in the binding.gyp of the module that fails, but unfortunately it doesn't help. Thanks!Wilhelmina
@Bernd, I was having this problem with Electron, can't speak of Node. I put that at the very top binding.gyp. You already should have the root opining { and closing } brackets there.Amie
Hacky: For build failures in external packages (gotten from npm install), I went into the node_modules and access the binding.gyp of the faultypackage at fault to append the openssl_fips as shared above. I am remove the build directory in the package directory. Doing npm install again after the change will be successful.Mallee
D
1

I have a same problem too, but i am using a serialport not epoll.

So, I think the cause of this problem is electron modules not the native module.

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.

This problem started yesterday. There were no problems in the last week.

I already installed the windows-build-tools, node-gyp, python 3.x.

I set the npm config & yarn config & python Env path, msvs_version too.

I reinstalled above packages many many times but not work electron-rebuild.

That is whole Error messages. There is no more Error messages.

What should we do?

Distillate answered 9/11, 2021 at 6:1 Comment(1)
The answear above seemed to work for me.Cutting
I
1

I use a PowerShell script based on @noseratio's answer.

    $path = ".\node_modules\@nodert-win10-rs4\windows.devices.geolocation\binding.gyp"

    $content = Get-Content $path
    $content = $content -replace '"USE_ADDITIONAL_WINMD": "true"', '"USE_ADDITIONAL_WINMD": "true", "openssl_fips": ""'
    $content | Set-Content $path -Encoding Ascii
Inveigle answered 25/10, 2023 at 1:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.