Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A build of my app does not work with iohook on windows. Can't find iohook.node #153

Closed
Maidomax opened this issue Mar 13, 2019 · 14 comments
Closed

Comments

@Maidomax
Copy link

I am very new to electron, but I think this error is not on me.
I have an electron app that works well on Ubuntu Linux 18.04, but fails when trying to run it on Windows 10 (64 bit).

Expected Behavior

I would expect the app to run and work just like on Linux

Current Behavior

When trying to start the app with electron ., the app crashes instantly with a Windows popup error window, and this in the console:

C:\Users\maido\Desktop\temp\webueno-tracker>electron .

 App threw an error during load
Error: The specified procedure could not be found.
\\?\C:\Users\maido\Desktop\temp\webueno-tracker\node_modules\iohook\builds\electron-v69-win32-x64\build\Release\iohook.node
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:722:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:160:31)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (C:\Users\maido\Desktop\temp\webueno-tracker\node_modules\iohook\index.js:10:21)
    at Object.<anonymous> (C:\Users\maido\Desktop\temp\webueno-tracker\node_modules\iohook\index.js:397:3)

I can in fact find the file that is supposedly missing at the path specified, but the path in the error message seems to be malformed. A similar error appears in the version of the app packaged with electron-packager regardless of whether I package it on Windows or Linux

Possible Solution

Native node extensions are way out of my comfort zone at the moment, but Googling around has brought me to this issue on a different package.
agracio/electron-edge-js#32

As you can see in the issue, the path is malformed in the same way, and it seems to be related to this issue:
https://electronjs.org/docs/tutorial/using-native-node-modules#troubleshooting
Regarding the win_delay_load_hook. Which is in the iohook package itself.

Steps to Reproduce (for bugs)

  1. Create an app with electron 4.0.4.
  2. Try and run it on Windows

Context

The app is supposed to track user activity and put it self on pause if there was no user activity in the last 5 minutes. That is what I am using iohook for. The feature works on Ubuntu Linux 18.04 LTS, but not on Windows. Windows and MacOS users are very important to me. I still have not tested it on a Mac.

Your Environment

Windows 10 64 bit
Iohook 0.4.0
Electron 4.0.4

@jakemingolla
Copy link

Same thing happens to me when running the https://github.com/wilix-team/iohook/tree/master/examples/electron-example example project

@GimpMaster
Copy link

I'm seeing the same problem with latest ABI version of electron 69.

@GimpMaster
Copy link

Here is the console error I'm getting as well.

Uncaught Error: The specified procedure could not be found.
\?\H:\test_app\node_modules\iohook\builds\electron-v69-win32-x64\build\Release\iohook.node
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:722)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:160:31)
at Module.load (internal/modules/cjs/loader.js:602)
at tryModuleLoad (internal/modules/cjs/loader.js:541)
at Function.Module._load (internal/modules/cjs/loader.js:533)
at Module.require (internal/modules/cjs/loader.js:640)
at require (internal/modules/cjs/helpers.js:20)
at Object. (H:\test_app\node_modules\iohook\index.js:10)

console.log('info: ', process.versions.modules);
Yields ABI: 69,
Using "win32", 64 bit
Node version: 10.15.1

@erfanium
Copy link

I have the same Problem on windows 10 x64 , electron 4.1.0 , iohook 0.4.0 on requiring iohook.
err:
Error: Cannot find module '.\node_modules\iohook\builds\electron-v69-win32-x64\build\Release\iohook.node' at Module._resolveFilename (internal/modules/cjs/loader.js:584:15) at Function.Module._resolveFilename (.\electron\dist\resources\electron.asar\common\reset-search-paths.js:43:12) at Function.Module._load (internal/modules/cjs/loader.js:510:25) at Module.require (internal/modules/cjs/loader.js:640:17) at require (internal/modules/cjs/helpers.js:20:18) at Object. (C.\node_modules\iohook\index.js:10:21) at Object. (.\node_modules\iohook\index.js:397:3) at Module._compile (internal/modules/cjs/loader.js:693:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:704:10) at Module.load (internal/modules/cjs/loader.js:602:32)

but it works with node js fine.

What your solution for this?
Does it exist a module for electron (worked on windows) for mouse event like iohook?

@GimpMaster
Copy link

Any updates with this version of iohook and latest version of electron 64-bit windows? if not I'll probably have to downgrade to an older version.

@anoadragon453
Copy link
Contributor

nodejs/node-addon-api#269 (comment) Seems to be what we have to do. Step 1 is easy enough, though Step 2 will require some code changes (hopefully quite simplistic)

@GimpMaster
Copy link

I'm just curious if anyone has gotten iohook with Electron 4.1.0 ABI 69 working. I just went back to Electron 2.0.0+ for the time being.

@anoadragon453
Copy link
Contributor

Yep, MacOS and Linux work fine. #144

@GimpMaster
Copy link

Can someone else publish a binary for Windows 10 64-bit? Seems the last release didn't compile properly.

@Djiit
Copy link
Collaborator

Djiit commented Mar 27, 2019

@GimpMaster could you help us with this ? #157

@GimpMaster
Copy link

@Djiit Absolutely. Just an FYI...I saw you pushed a new release 0.4.1. I did the following:

npm install https://github.com/wilix-team/iohook.git -save

This installed 0.4.1. I even confirmed the build folder:

electron-v69-win32-x64\build\Release had the same binaries as what is in the tagged release.

But I still get the following error.

Uncaught Error: The specified procedure could not be found. \\?\H:\Fast_Dev\line_app\node_modules\iohook\builds\electron-v69-win32-x64\build\Release\iohook.node at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31) at Object.Module._extensions..node (internal/modules/cjs/loader.js:722) at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:160:31) at Module.load (internal/modules/cjs/loader.js:602) at tryModuleLoad (internal/modules/cjs/loader.js:541) at Function.Module._load (internal/modules/cjs/loader.js:533) at Module.require (internal/modules/cjs/loader.js:640) at require (internal/modules/cjs/helpers.js:20) at Object.<anonymous> (H:\Fast_Dev\line_app\node_modules\iohook\index.js:10) at Object.<anonymous> (H:\Fast_Dev\line_app\node_modules\iohook\index.js:397)

I'll see what I can do in issue #157

@Djiit
Copy link
Collaborator

Djiit commented Apr 26, 2019

I'm closing this since it was resolved elsewhere.

@Djiit Djiit closed this as completed Apr 26, 2019
@karacas
Copy link

karacas commented Jul 20, 2019

@Maidomax
Maybe this help:
#160

@Maidomax
Copy link
Author

@Maidomax
Maybe this help:
#160

@karacas Did not help :(
Works on some machines, on some not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants