opencv4nodejs icon indicating copy to clipboard operation
opencv4nodejs copied to clipboard

Cannot use the package

Open thatAwesomeKK opened this issue 2 years ago • 7 comments

Have set the Environment variables image

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```

thatAwesomeKK avatar Apr 17 '23 11:04 thatAwesomeKK

same issue

lararojasmr avatar May 03 '23 15:05 lararojasmr

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)

UrielCh avatar May 05 '23 05:05 UrielCh

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

HCAWN avatar May 05 '23 15:05 HCAWN

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

UrielCh avatar May 06 '23 10:05 UrielCh

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:

  1. When using ones own build of OpenCV. what would build-opencv rebuild do?
  2. Can this issue be resolved without rebuilding OpenCV or is that command not rebuilding OpenCV, only rebuilding a node specific interpreter?

HCAWN avatar May 09 '23 08:05 HCAWN

@UrielCh Any news? Things have gone a bit quiet around here

HCAWN avatar Jul 28 '23 14:07 HCAWN

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.

UrielCh avatar Jul 28 '23 14:07 UrielCh