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

cant find darwin/fials compile gyp #317

Closed
2 of 3 tasks
richmailYT opened this issue Nov 24, 2021 · 11 comments
Closed
2 of 3 tasks

cant find darwin/fials compile gyp #317

richmailYT opened this issue Nov 24, 2021 · 11 comments

Comments

@richmailYT
Copy link

richmailYT commented Nov 24, 2021

Version
lastest

Short overview
cant find darwin/fials compile gyp
Issue occurs on

  • Virtual machine
  • Docker container
  • Dev/Host system

Detailed error description
https://pastebin.com/cMYYHTLm
Steps to reproduce error
npx create-electron-app@latest my-app
cd my-app
npm install @hut-tree/nut-js
npm start
error

Additional content

Please provide any (mandatory) additional data to reproduce the error (Dockerfiles etc.)

@richmailYT richmailYT changed the title deletes crital file cant find darwin/fials compile gyp Nov 24, 2021
@s1hofmann
Copy link
Member

s1hofmann commented Nov 24, 2021

Hi @richmailYT 👋

Which version of Electron are you using?

@richmailYT
Copy link
Author

@s1hofmann using 12.2.3 becuase one of my dependencys needs that version. Now it shows up as command not found even though its listed as a dev dependency in package.json

@richmailYT
Copy link
Author

upgraded to 16.0.2 to see if anything would change: nope

@s1hofmann
Copy link
Member

nut.js provides prebuilds for Electron 12.x.x., electron-rebuild should take care of that.

Are you using an M1 Mac or an Intel one?

@richmailYT
Copy link
Author

@s1hofmann im on an intel. How do I use electron-rebuild?

@s1hofmann
Copy link
Member

Install it via npm i electron-rebuild, then add something like

  "scripts": {
    "prestart": "electron-rebuild",
    "start": "electron ."
  },

to your package.json.

But just to make sure: I just did a double check following your mentions steps to reproduce.
The setup with Electron 12.2.3 and nut.js works out of the box?

@richmailYT
Copy link
Author

richmailYT commented Nov 25, 2021

@s1hofmann it dosnt work. It throws

App threw an error during load
Error: The module '/Users/richmail/Document/autoclicker-electron/node_modules/opencv4nodejs-prebuilt/build/Release/opencv4nodejs.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 87. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1846)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1138:18)
    at Object.func [as .node] (electron/js2c/asar_bundle.js:5:1846)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Module._load (internal/modules/cjs/loader.js:776:14)
    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.<anonymous> (/Users/richmail/Document/autoclicker-electron/node_modules/opencv4nodejs-prebuilt/lib/cv.js:11:8)
    at Module._compile (internal/modules/cjs/loader.js:1078:30)

with electron 12.2.3 and node 14.18.1

@s1hofmann
Copy link
Member

Could you please create a repo and link it here so I can verify it myself?

@richmailYT
Copy link
Author

@s1hofmann
Copy link
Member

It works like a charm with the exact steps I provided earlier.

node v16.13.0
Electron v12.2.3

Going to close this now, as I can't reproduce.

@richmailYT
Copy link
Author

I got ti to work. you add

"scripts": {
   "prestart": "electron-rebuild",
   "start": "electron ."
 },

to package.json after you have installed electron rebuild (delet package-lock.json and node moduals before nd reinstall everything with npm install)

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

2 participants