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

Cannot use the package #93

Open
thatAwesomeKK opened this issue Apr 17, 2023 · 7 comments
Open

Cannot use the package #93

thatAwesomeKK opened this issue Apr 17, 2023 · 7 comments

Comments

@thatAwesomeKK
Copy link

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```
@lararojasmr
Copy link

same issue

@UrielCh
Copy link
Owner

UrielCh commented May 5, 2023

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)

@HCAWN
Copy link

HCAWN commented May 5, 2023

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

@UrielCh
Copy link
Owner

UrielCh commented May 6, 2023

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

@HCAWN
Copy link

HCAWN commented May 9, 2023

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
Copy link

HCAWN commented Jul 28, 2023

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

@UrielCh
Copy link
Owner

UrielCh commented Jul 28, 2023

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.

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

4 participants