【问题标题】:zeromq w/ Electron: Could not locate the bindings filezeromq w/ Electron:找不到绑定文件
【发布时间】:2016-02-29 09:06:24
【问题描述】:

我使用的是 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 运行时我应该如何摆脱错误?

【问题讨论】:

    标签: javascript node.js npm zeromq electron


    【解决方案1】:

    在阅读Using Native Node Modules 后想通了。基本上,在原生包的每个 npm install 之后,需要通过发出 .\node_modules\.bin\electron-rebuild.cmd 使用 Electron 标头重新构建它。

    【讨论】:

    • 我运行“npm install --save-dev electron-rebuild”也运行“.\node_modules\.bin\electron-rebuild.cmd”但是这个解决方案对我不起作用;/
    猜你喜欢
    • 2014-09-14
    • 2022-12-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-11
    相关资源
    最近更新 更多