Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electron/Bcrypt error (NODE_MODULE_VERSION X. This version of Node.js requires NODE_MODULE_VERSION X. Please try re-compiling or re-installing) #3649

Closed
rblmdst opened this issue Mar 5, 2019 · 2 comments

Comments

@rblmdst
Copy link

rblmdst commented Mar 5, 2019

Hello Everyone

I am using Cypress for e2e test of one of the my project.

  • cypress : 3.1.5
  • Node : v10.15.0

I am currently trying to load/unload some fixtures in the Database before starting the test, for that purpose I used the cy.task command of cypress (described in this post https://glebbahmutov.com/blog/powerful-cy-task/ by @bahmutov ) in order to run the script that loads the fixture.

I am getting the following error when running cypress open

Error: The module '/home/modeste/Dev/o-food/node_modules/bcrypt/lib/binding/bcrypt_lib.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:172:20)
    at Object.Module._extensions..node (module.js:598:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:172:20)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/modeste/Dev/o-food/node_modules/bcrypt/bcrypt.js:6:16)
    at Object.<anonymous> (/home/modeste/Dev/o-food/node_modules/bcrypt/bcrypt.js:239:3)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)

When making searches I found that the issue is related to electron version of node and the node version used to build bcrypt; the solution proposed by many people to solve the issue is to rebuild electron using electron-rebuild package like describe in the following links:

I have also tried to rebuild bcrypt using :

npm rebuild bcrypt --update-binary

I have tried all that without any success, none of the solution worked for me, I am still getting the error.

It is almost 4 days that I am locked on it and I can not progress in my test anymore.

Any help or clue will be welcomed.

Thank you

@flotwig
Copy link
Contributor

flotwig commented Mar 7, 2019

@rblmdst Are you using the correct version of Electron for electron-rebuild? You ought to be able to rebuild bcrypt against our version of Electron by using this from your application's root directory. Try this:

npx electron-rebuild -v 1.8.2 -w bcrypt

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Mar 8, 2019
@rblmdst
Copy link
Author

rblmdst commented Mar 8, 2019

Hello @flotwig I have try the npx electron-rebuild -v 1.8.2 -w bcrypt and it is working now.
Thank you. 👍

@rblmdst rblmdst closed this as completed Mar 8, 2019
@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants