-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Work both with node and electron #144
Comments
Native modules have to be built for the Application Binary Interface (ABI) of the node runtime. By necessity, since the V8 headers don't match exactly between electron and node, they have different ABI numbers. You'll notice a period of where node.js skipped numbers because Electron was using those numbers. In short, it's impossible to run a native binary across two different ABI versions of node. To answer your question, there are a few options:
|
Thanks for the ELECTRON_RUN_AS_NODE tip and your explanations, I understand better. |
the same issue resolved by this:
every time you run 'npm install',you have to run this:
On window, if you have trouble, you can try this :
|
In the future, we should probably update node-zeromq to use N-API so it can be ABI stable across multiple versions of Node. |
Hi, just to tell that I managed to launch Jest using electron: jestjs/jest#3698 |
The latest 6.0 beta release now uses N-API and should work in Electron 3+ out of the box. It would be great if you could try it out! The new version has a new API that addresses some fundamental issues with the previous API, but it does include a compatibility layer that should make upgrading easier. See #189 for the reasoning behind the new API. If you run into any problems feel free to report it here or in a new issue. |
Hi,
I use zeromq in a an electron app, so I rebuilt zeromq according to the command given in the docs:
npm rebuild zeromq --runtime=electron --target=1.6.1
But, well, now it's broken for node. When running jest, it complains that
Module version mismatch. Expected 48, got 53.
, 53 being the Electron version, while 48 corresponds to my Node version.This is annoying for setting up a correct development environment. I do not seem to be the first to meet this issue, but I found no solution.
To my mind, the module version should only be checked against node version, not eletron version, so that if I use the same version of node as electron I should not see this issue. To sum it up:
Today I got this:
I use Electron version : 53 / I use Node version 48 ===> mismatch error
But I should have this instead:
I use Electron version 53 ; Electron uses Node version 48 / I use Node version 48 ===> no mismatch error
Is that doable ?
The text was updated successfully, but these errors were encountered: