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

zeromq w/ Electron: Could not locate the bindings file

我正在使用 Windows 7 x64、nodejs 5.1.0 和 Electron 0.35。我按照 Electron Quick Start app 的说明进行操作,然后将行 require("zmq") 添加到 main.js。此时,npm install zmq --save后,electron main.js显示:

Error: Could not locate the bindings file. Tried: [zmq.node 路径列表]

其中一个尝试的路径实际上存在于系统中,即node_modules/zmq/build/Release/zmq.node

如果我删除 Electron 应用程序代码并仅在 main.js 中保留 require("zmq") 行,我可以成功 运行 和 node main.js。 运行 Electron 时我该如何消除错误?

看完Using Native Node Modules就明白了。基本上,在每个 npm install 个原生包之后,需要通过发出 .\node_modules\.bin\electron-rebuild.cmd.

用 Electron headers 重建它