iohook icon indicating copy to clipboard operation
iohook copied to clipboard

Path for iohook not found.

Open mathmpr opened this issue 4 years ago • 1 comments

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:

  • C:\Users\Matheus Prado\projects\personal\electron-quick-start\node_modules\iohook\index.js
  • C:\Users\Matheus Prado\projects\personal\electron-quick-start\main.js
  • C:\Users\Matheus Prado\projects\personal\electron-quick-start\node_modules\electron\dist\resources\default_app.asar\main.js
  • at Module._resolveFilename (internal/modules/cjs/loader.js:887:15) at Function.n._resolveFilename (electron/js2c/browser_init.js:257:1128) at Module._load (internal/modules/cjs/loader.js:732:27) at Function.f._load (electron/js2c/asar_bundle.js:5:12913) at Module.require (internal/modules/cjs/loader.js:959:19) at require (internal/modules/cjs/helpers.js:88:18) at Object. (C:\Users\Matheus Prado\projects\personal\electron-quick-start\node_modules\iohook\index.js:24:21) at Module._compile (internal/modules/cjs/loader.js:1078:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10) at Module.load (internal/modules/cjs/loader.js:935:32)

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

mathmpr avatar Aug 29 '21 18:08 mathmpr

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

marcelblum avatar Aug 31 '21 01:08 marcelblum