wilix-team / iohook

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

Cannot find module undefined #355

Open robin-garnham opened 3 years ago

robin-garnham commented 3 years ago

I'm getting an error when attempting to include iohook in my application. I'm using Electron + Create React App. It's an existing application that I'm trying to add a feature to.

Expected Behavior

Package imported, and able to be used.

Current Behavior

I receive a React error message that says: Error: Cannot find module '/builds/node-vundefined-undefined-undefined/build/Release/iohook.node'

Steps to Reproduce (for bugs)

const ioHook = require('iohook');

"iohook": {
    "targets": [
      "node-88",
      "electron-85"
    ],
    "platforms": [
      "win32",
      "darwin",
      "linux"
    ],
    "arches": [
      "x64",
      "ia32"
    ]
  }

Context

Just trying to bring in the library so that I can track mouse events (move and click) outside of the Electron windows that I'm showing.

Your Environment

package.json "electron": "^11.1.1", "iohook": "^0.9.3",

node_modules/iohook/builds ls -al
total 0
drwxr-xr-x  12 robin  staff  384 25 Aug 11:42 .
drwxr-xr-x  17 robin  staff  544 25 Aug 12:04 ..
drwxr-xr-x   3 robin  staff   96 25 Aug 11:42 electron-v85-darwin-x64
drwxr-xr-x   3 robin  staff   96 25 Aug 11:42 electron-v85-linux-ia32
drwxr-xr-x   3 robin  staff   96 25 Aug 11:42 electron-v85-linux-x64
drwxr-xr-x   3 robin  staff   96 25 Aug 11:42 electron-v85-win32-ia32
drwxr-xr-x   3 robin  staff   96 25 Aug 11:41 electron-v85-win32-x64
drwxr-xr-x   3 robin  staff   96 25 Aug 11:41 node-v88-darwin-x64
drwxr-xr-x   3 robin  staff   96 25 Aug 11:41 node-v88-linux-ia32
drwxr-xr-x   3 robin  staff   96 25 Aug 11:41 node-v88-linux-x64
drwxr-xr-x   3 robin  staff   96 25 Aug 11:41 node-v88-win32-ia32
drwxr-xr-x   3 robin  staff   96 25 Aug 11:41 node-v88-win32-x64