[英]zeromq w/ Electron: Could not locate the bindings file
I'm using Windows 7 x64, nodejs 5.1.0 and Electron 0.35. 我使用的是Windows 7 x64,nodejs 5.1.0和Electron 0.35。 I followed the instructions from Electron Quick Start app and then added the line
require("zmq")
to the main.js. 我按照电子快速启动应用程序的说明 ,然后将行
require("zmq")
到main.js. At this point, after npm install zmq --save
, electron main.js
displays: 此时,在
npm install zmq --save
, electron main.js
显示:
Error: Could not locate the bindings file. Tried:
Error: Could not locate the bindings file. Tried:
[list of zmq.node
paths] Error: Could not locate the bindings file. Tried:
[ zmq.node
路径列表]
One of the paths tried is actually present in the system, ie node_modules/zmq/build/Release/zmq.node
其中一条路径实际上存在于系统中,即
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
. 如果我删除电子应用程序代码并在main.js中只留下
require("zmq")
行,我可以使用node main.js
成功运行。 How am I supposed to get rid of the error when running with Electron? 我怎么能在使用Electron运行时摆脱错误?
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
. 基本上,在每次
npm install
本机程序包之后,需要通过发出.\\node_modules\\.bin\\electron-rebuild.cmd
来重建Electron标头。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.