wilix-team / iohook

Node.js global keyboard and mouse listener.
https://wilix-team.github.io/iohook
MIT License
1.19k stars 291 forks source link

Path for iohook not found. #357

Open mathmpr opened 3 years ago

mathmpr commented 3 years ago

I try to install a clean electron app with node and print keyup event in console using iohook.

Expected Behavior

npm start works fine and every keyup prints event in console.

Current Behavior

Cannot find module 'C:\Users\Matheus Prado\projects\personal\electron-quick-start\node_modules\iohook\builds\electron-v89-win32-x64\build\Release\iohook.node' Require stack:

Possible Solution

Improve the way the path is formed, or explain some things better. I tried changing the folder name and then the error changed, saying you had node_module V 89 and the plugin needed V 83 and I just didn't understand what that meant.

Steps to Reproduce (for bugs)

Install Node from: https://nodejs.org/download/release/v14.16.0/ Install electron with: npm i -D electron@latest Install iohook with: npm install iohook --save

And put this code in main.js of minimal project of electron:

const ioHook = require('iohook');

ioHook.on("keyup", event => {
  console.log(event); // {keychar: 'f', keycode: 19, rawcode: 15, type: 'keup'}
});

ioHook.start();

Your Environment

Node.js 14.16.0 Electron: 13.2.2 SO: Windows Pro x64 ioHook: 0.9.3

marcelblum commented 3 years ago

Check the docs for supported targets, Electron 13 is not yet supported https://wilix-team.github.io/iohook/installation.html