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

Electron + Windows problems #126

Closed
bluedarker opened this issue May 6, 2020 · 5 comments
Closed

Electron + Windows problems #126

bluedarker opened this issue May 6, 2020 · 5 comments
Assignees
Labels
bug Something isn't working DONE Implementation is done, but not yet merged into master

Comments

@bluedarker
Copy link

Version
@nut-tree/nut-js@1.4
Windows 10 version 1809(build 17763.1158)
Electron 8.2.3
Node 12.13.0

Short overview
Can't use with Electron, got an error

Detailed error description

Error: A dynamic link library (DLL) initialization routine failed.
\\?\c:\workspace\electron-quick-start\node_modules\@nut-tree\libnut-win32\build\Release\libnut.node
    at process.func (electron/js2c/asar.js:140:31)
    at process.func [as dlopen] (electron/js2c/asar.js:140:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1016:18)
    at Object.func (electron/js2c/asar.js:140:31)
    at Object.func [as .node] (electron/js2c/asar.js:140:31)
    at Module.load (internal/modules/cjs/loader.js:816:32)
    at Module._load (internal/modules/cjs/loader.js:728:14)
    at Module._load (electron/js2c/asar.js:717:26)
    at Function.Module._load (electron/js2c/asar.js:717:26)
    at Module.require (internal/modules/cjs/loader.js:853:19)

Steps to reproduce error

with Electron quick start example
obtain this error only require @nut-tree/nut-js

below is my change code in main.js

const {app, BrowserWindow,ipcMain} = require('electron')
const path = require('path')
const {
  mouse,
  left,
  right,
  up,
  down
} = require('@nut-tree/nut-js');
function createWindow () {
  // Create the browser window.
  const mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      preload: path.join(__dirname, 'preload.js')
    }
  })

this is error screenshot
image

s1hofmann added a commit that referenced this issue May 7, 2020
(#126) Updated libnut to v2.0.0 to solve Electron problems on Windows
@s1hofmann
Copy link
Member

Hi @bluedarker,

I was able to locate the root cause for this problem and my tests with Electron on Windows were successful.
Could you please give @nut-tree/nut-js@next a try?

Best regards

Simon

@s1hofmann s1hofmann self-assigned this May 7, 2020
@s1hofmann s1hofmann added the bug Something isn't working label May 7, 2020
@bluedarker
Copy link
Author

Hi @s1hofmann
Every thing is normal whit @nut-tree/nut-js@next.

Thank you for your contribution. It's realy greate moudle

@s1hofmann s1hofmann added DONE Implementation is done, but not yet merged into master feature New features and removed feature New features labels May 10, 2020
@s1hofmann
Copy link
Member

Closed with release v1.4.1

@danielehrhardt
Copy link

I had to install please make sure to have the Microsoft Visual C++ Redistributable installed.

@s1hofmann
Copy link
Member

In general, please make sure to check prerequisites

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working DONE Implementation is done, but not yet merged into master
Projects
None yet
Development

No branches or pull requests

3 participants