[英]Local native Node module causes error: Uncaught Error: No native build was found for platform=win32 arch=x64 runtime=electron abi=75 uv=1 libc=glibc
[英]No native build was found for platform=darwin arch=arm64 runtime=electron abi=103
我目前正在尝试在我的电子应用程序中使用以下包:
https://github.com/SnosMe/uiohook-napi
但无论我做什么,我总是在控制台中得到上述错误。
我通过以下方式访问预加载文件中的包
import { uIOhook, UiohookKey } from 'uiohook-napi';
uIOhook.on('keydown', (e) => {
if (e.keycode === UiohookKey.Q) {
console.log('Hello!');
}
if (e.keycode === UiohookKey.Escape) {
process.exit(0);
}
});
uIOhook.start();
并尝试了以下步骤:
通过 npm install uihook-napi 安装它
做了一个 ./node_modules/.bin/electron-rebuild
通过 node-gyp configure build 在 node_modules 文件夹中手动构建包
通过 HOME=~/.electron-gyp node-gyp rebuild --target=18.2.3 --arch=arm64 --dist-url=https://electronjs.org/headers 手动重建
因为这不是我第一次遇到与本机模块类似的问题,所以我很确定我的想法中有一个障碍
在这种情况下,问题在于发布 package.json 中缺少依赖项
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.