Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

zeromq w/ Electron: Could not locate the bindings file

I'm using Windows 7 x64, nodejs 5.1.0 and Electron 0.35. I followed the instructions from Electron Quick Start app and then added the line require("zmq") to the main.js. At this point, after npm install zmq --save, electron main.js displays:

Error: Could not locate the bindings file. Tried: [list of zmq.node paths]

One of the paths tried is actually present in the system, i.e. node_modules/zmq/build/Release/zmq.node

If I remove the Electron app code and leave just the require("zmq") line in main.js, I can successfully run with node main.js. How am I supposed to get rid of the error when running with Electron?

like image 992
adrian.nicolau Avatar asked Nov 26 '15 10:11

adrian.nicolau


Video Answer


1 Answers

Figured it out after reading Using Native Node Modules. Basically, after each npm install of a native package, it needs to be rebuilt with Electron headers by issuing .\node_modules\.bin\electron-rebuild.cmd.

like image 120
adrian.nicolau Avatar answered Sep 27 '22 22:09

adrian.nicolau