electron / rebuild

Package to rebuild native Node.js modules against the currently installed Electron version
MIT License
1.02k stars 174 forks source link

undefined symbol errors on electron 3.0.3 + node-ffi #254

Open d9k opened 5 years ago

d9k commented 5 years ago

Hello!

I have node-ffi dependency in my electron application installed as

cd ./app
npm install --save https://github.com/node-ffi/node-ffi.git
cd ..

When I run command

$(npm bin)/electron-rebuild -f

it seems like only ref module is being rebuilt (another native dependency of my project), no message about node-ffi on screen (how to get verbose output)?

When I run my electron application with npm run start I get an error:

/home/user/my-electron-app/node_modules/electron/dist/electron app:
symbol lookup error: /home/user/my-electron-app/app/node_modules/ffi/build/Release/ffi_bindings.node:
undefined symbol: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeE

Versions info

➜ $(npm bin)/electron --version             
v3.0.3
➜ $(npm bin)/electron-rebuild --version
Electron Rebuild Version: 1.8.2
➜ npm --version
6.4.1
➜ node --version
v10.10.0
➜ lsb_release -a
Release:        16.04
Codename:       xenial

I've found related discussion https://github.com/electron/libchromiumcontent/pull/570 but I can't fully understand an issue and way to fix it.

timfish commented 5 years ago

This is usually an incompatibility between the native module and the node version you're compiling against.

node-ffi has not been updated to work in Node v10 that Electron v3 uses. You might have to use one of the forks mentioned here.