Open sollosollo4 opened 1 month ago
right now I found buildRoot
interesting, maybe if I specify it..
Still have issue. I dont know how to package it correctly
maybe the same issue -
npm error gyp: Call to 'node ./bin/install.js OPENCV4NODEJS_DEFINES' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
Tried to install opencv and cmake via choco - didn't helped Tried re-install node-gyp: npx node-gyp install - didn't helped Tried removing all caches ( windows local/appdata and from electron/node-packages) - didn't helped
Being hopeless, tried install via pnpm - pnpm install @u4/opencv4nodejs and it finally worked! I don't know why it workes with pnpm and not with npm.
@studentutu I don't know, it seems like you have something different. here is an issue in which I was able to figure out how to install this, but my problem lies precisely in the package in the installation file https://github.com/UrielCh/opencv4nodejs/issues/121
maybe the same issue -
npm error gyp: Call to 'node ./bin/install.js OPENCV4NODEJS_DEFINES' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
Tried to install opencv and cmake via choco - didn't helped Tried re-install node-gyp: npx node-gyp install - didn't helped Tried removing all caches ( windows local/appdata and from electron/node-packages) - didn't helped
Being hopeless, tried install via pnpm - pnpm install @u4/opencv4nodejs and it finally worked! I don't know why it workes with pnpm and not with npm.
Same here except pnpm giv the same gyp: Call to 'node ./bin/install.js OPENCV4NODEJS_DEFINES' returned exit status 1
error.
problem description: I'm running the electron application and found that it works correctly with @u4/opencv4nodejs (no errors on startup). after which I create a program installer using electron-builder, transfer this installer to another PC, install the program - it installs correctly. When I start the program I get the error: opencv binary does not exist. after which, it shows me the path along which he is trying to get opencv binary, equal to the path where he launched it from the developer’s PC (C:\some_directories\project\node_modules\@u4\opencv-build\dist\latest\build\bin\Release )
What am I doing?
I have an electron+react application. I'm using @u4/opencv-build to auto build opencv.
Before packing I do the following:
I already have a ready to go build opencv directory generated with:
But I see how electron-builder tried to package it inside the project. but he's still doing it wrong.
Unfortunately, I’ve given up and can’t do it in any way. After all, my application in any case looks for the library in the wrong path, and I haven’t found a way to configure this manually.
Here is my package.json
npx build-opencv --electron --nocontrib rebuild
This works correctly for "autoBuildOpencvVersion": "4.8.0" + "electron": "^28.0.0" "electron-builder": "^24.9.1" "electron-rebuild": "^3.2.9" After which, I prepare the react and electron directories: "build-react": "react-scripts build", "build-electron": "mkdir build/electron & mkdir build/opencv & robocopy electron build/electron /S",npm run build-react
npm run build-electron
After which all I have to do is create a packer using the electron-builder utility "package": "electron-builder build --win --publish never",npm run package
I get a dist folder in which I have the following structure: