iohook
iohook copied to clipboard
was compiled against a different Node.js version using
trafficstars
sudo apt-get install -y libxkbcommon-x11-0
[sudo] password for hiwyn:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libxkbcommon-x11-0 is already the newest version (1.0.3-2).
0 upgraded, 0 newly installed, 0 to remove and 139 not upgraded.
node -v
v12.22.5
node index.js
load_input_helper [1918]: Using XFree86 keyboard layout.
load_input_helper [1920]: XKB support is required to accurately determine keyboard characters!
internal/modules/cjs/loader.js:1057
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: The module '/home/hiwyn/tendonitis/node_modules/iohook/builds/node-v72-linux-x64/build/Release/iohook.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 87. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1057:18)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/hiwyn/tendonitis/node_modules/iohook/index.js:24:21)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
SO: Debian 11
the code is just:
const ioHook = require("iohook");
ioHook.on("keypress", (event) => {
console.log(event);
if (event.keychar == "a") {
console.log("wow! A pressed!");
}
// {keychar: 'f', keycode: 19, rawcode: 15, type: 'keypress'}
});
ioHook.start();
what should i do?
So my node v12.22.5
https://nodejs.org/en/download/releases/
is uses NODE_MODULE_VERSION 72
Looks like i need NODE_MODULE_VERSION 87 but there is no 87 https://i.stack.imgur.com/c4vIp.png
what should i do?