npm ref could not locate the bindings file error

安稳与你 提交于 2019-12-24 00:40:01

问题


I'm using the package ref in my nodejs project that makes use of electron. But the problem is when I use ref in my JS code, it throws an error that it could not locate the bindings file. Here's the error

Error: Could not locate the bindings file. Tried:

→ C:...\EMVModule.asar\node_modules\ref\build\binding.node → C:...\EMVModule.asar\node_modules\ref\build\Debug\binding.node → C:...\EMVModule.asar\node_modules\ref\build\Release\binding.node → C:...\EMVModule.asar\node_modules\ref\out\Debug\binding.node → C:...\EMVModule.asar\node_modules\ref\Debug\binding.node → C:...\EMVModule.asar\node_modules\ref\out\Release\binding.node → C:...\EMVModule.asar\node_modules\ref\Release\binding.node → C:...\EMVModule.asar\node_modules\ref\build\default\binding.node → C:...\EMVModule.asar\node_modules\ref\compiled\6.5.0\win32\x64\binding.node at bindings (C:...\EMVModule.asar\node_modules\bindings\bindings.js:88:9) at Object. >(C:...\EMVModule.asar\node_modules\ref\lib\ref.js:5:47) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at Object. >(C:...\EMVModule.asar\node_modules\ffi\lib\ffi.js:6:11)

I tried using electron rebuild as well and I tried to use node-gyp to rebuild but to no use. Is there any way to solve this problem?

Thanks


回答1:


After a lot of trial and error, finally this command did the magic

node-gyp rebuild --target=1.4.0 --arch=x64 --dist-url="https://atom.io/download/atom-shell" --msvs_version=2015


来源:https://stackoverflow.com/questions/42022702/npm-ref-could-not-locate-the-bindings-file-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!