简体   繁体   English

zeromq w / Electron:找不到绑定文件

[英]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 --saveelectron 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM