1

I am trying to use libxmljs2 for use on both (1) a simple node.js application and (2) an Electron application.

So the versions I am using are the following:

Electron: 11.2.0 (ABI version 85)
Node.js: 12.20.1 (ABI version 72)

So my problem is.. since I am using a shared node_module (this is our architecture so I can't deviate from it) for the node.js app and electron app:

  • when I rebuild libxmljs2 with npm rebuild - it works well for node.js but not for the electron app
  • when I rebuild with electron-rebuild --module-dir libxmljs2 then it works for the electron app but not for node.js

So I say shared node_modules as this:

developmentFolder
|_ node_modules
|_ node-app
|_ electron-app

node-app and electron-app share with node_modules. Both node-app and electron-app do not have their own node_modules folder inside.

Help anyone?

kzaiwo
  • 1,558
  • 1
  • 16
  • 45
  • it's unfortunate, but you cannot share same binary between two different abi incompatible runtime. 1. rebuild each time as you mentioned 2. split module location to have separate binary 3. upstream supports n-api works on different abi is only way. – OJ Kwon Feb 03 '21 at 19:38

0 Answers0