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

Wrong binaries in prebuild versions for electron v70/v73 #338

Closed
qwe313 opened this issue Aug 28, 2019 · 11 comments
Closed

Wrong binaries in prebuild versions for electron v70/v73 #338

qwe313 opened this issue Aug 28, 2019 · 11 comments

Comments

@qwe313
Copy link

qwe313 commented Aug 28, 2019

It seems that binaries that are labeled by zeromq-v5.1.0-electron-v70-X and zeromq-v5.1.0-electron-v73-X are actually built against NODE_MODULE_VERSION 47 and 48 respectively.

Error: The module `...\node_modules\zeromq\build\Release\zmq.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 47. This version of Node.js requires
NODE_MODULE_VERSION 70. Please try re-compiling or re-installing

Error: The module `...\node_modules\zeromq\build\Release\zmq.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 70. Please try re-compiling or re-installing

@qwe313
Copy link
Author

qwe313 commented Aug 30, 2019

@lgeiger Can you take a look please?

@andsav
Copy link

andsav commented Sep 2, 2019

Indeed, these binaries are wrong will not work with Electron 6 . You need to rebuild manually:

cd node_modules/zeromq/

HOME=~/.electron-gyp node-gyp rebuild --target=6.0.0 --arch=x64 --dist-url=https://electronjs.org/headers

@qwe313
Copy link
Author

qwe313 commented Sep 4, 2019

@andsav can you please confirm that manual build works? I've tried it either but surprisingly got the same result, for --target=6.0.0 it was node_module_version 48 and for --target=5.0.0 it was 47. Probably i did something wrong

@crnbarr93
Copy link

@andsav Attempting to run this command produces an error for me:

Command: node-gyp rebuild --target=6.0.0 --arch=x64 --dist-url=https://electronjs.org/headers

Error:
LINK : fatal error LNK1104: cannot open file 'C:\Users\...\node_modules\zeromq\build\Release\..\..\windows\lib\libzmq.lib' [C:\Users\...\node_modules\zeromq\build\zmq.vcxproj]

This is using Visual Studio 2017 on Windows 10.

@andsav
Copy link

andsav commented Sep 4, 2019

@qwe313 manual build works for me with the command above (not npm rebuild since that will try to download the binaries from github first which are wrong)

@crnbarr93 for windows, try downloading the libzmq-4.2.0-x64.lib here: https://github.com/nteract/libzmq-win/tree/master/v140 and copy it to node_modules/zeromq/windows/lib/libzmq.lib then run the command again

@crnbarr93
Copy link

@andsav that worked! Thanks!

@kyleerik
Copy link

Any idea when the precompiled binaries will be corrected? I wasted the better part of a day looking for this solution. It'd be great to save others the grief.

@andsav and @crnbarr93 you maybe interested to know that the zeromq package.json already includes a script named build:libzmq which downloads the appropriate libzmq.lib for you.

My solution was to create a script in my package.json specifically for rebuilding zeromq manually. It looks like this:

"rebuild:zeromq": "cd node_modules\\zeromq && npm run build:libzmq && node-gyp rebuild --target=6.0.12 --arch=ia32 --dist-url=https://electronjs.org/headers"

Obviously the target value will have to be updated anytime I change the version of Electron, but it matches the version I've specified in the devDependencies section of my package.json and I can give this file to another developer and it'll work for them, which was my first concern.

Note: my devenv is Windows 10 and I'm using currently latest Electron, 6.0.12

@lgeiger
Copy link
Member

lgeiger commented Oct 22, 2019

Could you check if the issue is still present in the v5.1.1 release?

@muhammad-saleh
Copy link

Can confirm it works fine:

ZeroMQ: 5.1.1
Node 12.11.1
Electron 6.0.11

image

Thanks a lot @lgeiger

@lgeiger
Copy link
Member

lgeiger commented Oct 22, 2019

Great! This was due to a bug in prebuild that mixed Node and Electron versions due to a caching bug: #344

@axfelix
Copy link

axfelix commented Apr 14, 2020

Hi,

Can this issue be reopened? The prebuilt zeromq binaries still aren't declaring compatibility with a supported Electron version, and attempting to rebuild this library on Windows has never worked for me (lots of MSVC compiler errors and I'm not sure if there's a way I can tell it to use mingw gcc to build instead like you can with Windows Python).

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

7 participants