npm ref 找不到绑定文件错误 [英] npm ref could not locate the bindings file error

查看:51
本文介绍了npm ref 找不到绑定文件错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用电子的 nodejs 项目中使用包 ref.但问题是当我在我的 JS 代码中使用 ref 时,它会抛出一个错误,指出它无法找到绑定文件.这是错误

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在绑定 (C:...\EMVModule.asar\node_modules\bindings\bindings.js:88:9)在对象.>(C:...\EMVModule.asar\node_modules\ref\lib\ref.js:5:47)在 Module._compile (module.js:556:32)在 Object.Module._extensions..js (module.js:565:10)在 Module.load (module.js:473:32)在 tryModuleLoad (module.js:432:12)在 Function.Module._load (module.js:424:3)在 Module.require (module.js:483:17)在要求(内部/module.js:20:19)在对象.>(C:...\EMVModule.asar\node_modules\ffi\lib\ffi.js:6:11)

→ 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)

我也尝试使用电子重建,我尝试使用 node-gyp 重建但没有用.有什么办法可以解决这个问题吗?

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?

谢谢

推荐答案

经过反复试验,终于这个命令发挥了作用

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

这篇关于npm ref 找不到绑定文件错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆