-
Notifications
You must be signed in to change notification settings - Fork 51
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
Module did not self-register error when using Electron #43
Comments
I'm still not using Electron, can not help with that. |
opencv4nodejs will not compile against electron version >18 at the moment due to a changed interface in v8 api. There was a pull request for the nan package that seemed to fix this compile issue but they changed it to a different approach and closed the official pull request, I forked that branch to keep my build alive. Here is a package.json that will build correctly for latest electron.
|
Here is the source of that info along with an explanation to the cause of this issue. |
I have same error as aformentioned, I've tried installing electron 18, adding Maybe I'm doing something wrong? Clean install of my project is done by those commands: Error:
|
OpenCV version: 4.6.0
Node version: 16.16.0
Electron version: 20.0.1
Electron-rebuild version: 3.2.9
@u4/opencv4nodejs version: 6.2.1
@u4/opencv-build version: 0.5.3
OS: Windows 10 x64
I have Visual Studio and Windows Build Tools already installed.
Variables in package.json:
I finally managed to get opencv4nodejs to work. But it only works in my Nodejs runtime, when running node scripts directly in terminal. But with Electron I cannot get it to work.
After having installed all my packages with
npm install
I then build opencv with the npm-script that is defined as:build-opencv --nobuild rebuild
. This seems to be succesful. I can then run scripts in terminal that use @u4/opencv4nodejs. However if I launch an Electron app usingelectron .
I get the following error:If I got into the build folder for opencv4nodejs I can see that the build files are there, and like I said, it works in regular nodejs scripts but just not in Electron.
If I try to rebuild electron using
./node_modules/.bin/electron-rebuild
that doesn't seem to help at all.I then try to rebuild electron with
build-opencv --electron --version 4.6.0 build
(copied from the readme of this project). That doesn't work because then I get errors, please see file:electron-rebuild-error.txt
The text was updated successfully, but these errors were encountered: