1

I have a node project in which I use NodeJS 14.15.0 and the latest build of Electron 12.0.0.

NodeJS version 14.15.0 has a NODE_MODULE_VERSION 83 according to their webpage.

enter image description here

Electron version v12.0.0 uses this node version of 14.15.0. but on their webpage it says the module NODE_MODULE_VERSION is 87

enter image description here

Therefore I have a mismatch between these two versions. I need a match so I can load the same binary intro an Electron app + execute by a node.js instance.

Daniel Stephens
  • 2,371
  • 8
  • 34
  • 86
  • ``To bounty hunters``: This question is different to a previous of mine I asked a few weeks ago, but anyone who can solve this question potentially solves my other question which has an active bounty of `+100!` https://stackoverflow.com/questions/64625765/incorrect-node-module-version-when-using-ava – Daniel Stephens Nov 13 '20 at 04:30

1 Answers1

5

Electron maintains and compiles their own fork of Node, in a way that may not be compatible with normal Node. Electron intentionally uses unique NODE_MODULE_VERSION to signal this fact to software.

You'll need to recompile native modules using electron-rebuild.

Native Node modules are supported by Electron, but since Electron is very likely to use a different V8 version from the Node binary installed on your system, the modules you use will need to be recompiled for Electron.

(electron docs)

The maintainers of Node and Electron discussed possible options, and decided to use offset versioning in this issue:

https://github.com/nodejs/TSC/issues/651

Sidney
  • 4,495
  • 2
  • 18
  • 30
  • Thank you sooo much! This makes so much sense now! Please feel free to take this answer and copy it to my other question or just post a link to get the 100 points bounty. I was looking for this information everywhere and simply missed this. – Daniel Stephens Nov 13 '20 at 04:58