Cannot use the package
Have set the Environment variables

Still Getting Error while using the package
node index.js
info config no opencv4nodejs section found in D:\NextJs\gameDetector\package.json
D:\NextJs\gameDetector\node_modules\@u4\opencv4nodejs\lib\cvloader.js:103
throw Error(msg);
^
Error: require("D:\NextJs\gameDetector\node_modules\@u4\opencv4nodejs\build\Release\opencv4nodejs");
Failed with: Cannot find module 'D:\NextJs\gameDetector\node_modules\@u4\opencv4nodejs\build\Release\opencv4nodejs'
Require stack:
- D:\NextJs\gameDetector\node_modules\@u4\opencv4nodejs\lib\cvloader.js
- D:\NextJs\gameDetector\node_modules\@u4\opencv4nodejs\lib\opencv4nodejs.js
- D:\NextJs\gameDetector\index.js, openCV binding not available, reed:
build-opencv --help
And build missing file with:
npx build-opencv --version 4.6.0 rebuild
PS: a 'npm link' may help
at getOpenCV (D:\NextJs\gameDetector\node_modules\@u4\opencv4nodejs\lib\cvloader.js:103:23)
at loadOpenCV (D:\NextJs\gameDetector\node_modules\@u4\opencv4nodejs\lib\opencv4nodejs.js:6:48)
at Object.<anonymous> (D:\NextJs\gameDetector\node_modules\@u4\opencv4nodejs\lib\opencv4nodejs.js:21:12)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Module._load (node:internal/modules/cjs/loader:827:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (D:\NextJs\gameDetector\index.js:1:12)
Node.js v18.0.0```
same issue
Please provide all the lines you tape to produce the error and your environment variables.
in your case try a build-opencv rebuild without the version argument.
and please define your OPENCV_BUILD_ROOT environment variable. (in your case this folder should stay empty)
When using ones own build of OpenCV. what would build-opencv rebuild do?
Can this issue be resolved without rebuilding OpenCV or is that command not rebuilding OpenCV, only rebuilding a node specific interpreter?
In the "original" repo, I was able to install OpenCV using chocolatey, then install the node package while disabling autobuild, pointing to the correct lib, includes and bin directories, and the node_modules\opencv4nodejs\build directory was filled
H
Do so, use the chocolate build, The project contains a special code for that purpose.
and this case is tested by github action just here:
https://github.com/UrielCh/opencv4nodejs/blob/master/.github/workflows/prebuild.yml
When I run build-opencv rebuild It is failing due to my not having Visual Studio installed.
I do not want to install Visual Studio but more importantly, I presume it needs VS due to it rebuild OpenCV which I don't want to do as I already have a version installed.
So I guess I go back to these two questions:
- When using ones own build of OpenCV. what would
build-opencv rebuilddo? - Can this issue be resolved without rebuilding OpenCV or is that command not rebuilding OpenCV, only rebuilding a node specific interpreter?
@UrielCh Any news? Things have gone a bit quiet around here
I'm currently working on a react native project that do not use openCV, I can not help you with that for now.
I have a familly to feed...
and yes you need visual studio installed to make it works.