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

An error occurred when I executed the npx build-opencv --version 4.6.0 rebuild command,However, it is normal in @u4/opencv4nodejs6.5.2 #136

Open
jay-gaojing opened this issue May 2, 2024 · 7 comments

Comments

@jay-gaojing
Copy link

image

@jay-gaojing jay-gaojing changed the title An error occurred when I executed the npx build-opencv --version 4.6.0 rebuild command An error occurred when I executed the npx build-opencv --version 4.6.0 rebuild command,However, it is normal in 6.5.2 May 2, 2024
@jay-gaojing jay-gaojing changed the title An error occurred when I executed the npx build-opencv --version 4.6.0 rebuild command,However, it is normal in 6.5.2 An error occurred when I executed the npx build-opencv --version 4.6.0 rebuild command,However, it is normal in @u4/opencv4nodejs6.5.2 May 2, 2024
@UrielCh
Copy link
Owner

UrielCh commented May 3, 2024

@u4/Opencv-build@1.0.0 is not compatible with V6.

please upgrade to @u4/opencv4nodejs@V7

@AlexSmirnov9107
Copy link

AlexSmirnov9107 commented May 6, 2024

same here

package.json

"dependencies": {
   
    "@u4/opencv-build": "^1.0.0",
    "@u4/opencv4nodejs": "^7.0.0",
   
  },
 "opencv4nodejs": {
    "disableAutoBuild": 1,
    "opencvIncludeDir": "/opt/homebrew/Cellar/opencv/4.9.0_6/include/opencv4/",
    "opencvLibDir": "/opt/homebrew/Cellar/opencv/4.9.0_6/lib/",
    "opencvBinDir": "/opt/homebrew/Cellar/opencv/4.9.0_6/bin/"
  }

@UrielCh
Copy link
Owner

UrielCh commented May 6, 2024

you can remove:
"opencvIncludeDir": "/opt/homebrew/Cellar/opencv/4.9.0_6/include/opencv4/",
"opencvLibDir": "/opt/homebrew/Cellar/opencv/4.9.0_6/lib/",
"opencvBinDir": "/opt/homebrew/Cellar/opencv/4.9.0_6/bin/"

homebrew's openCV is autodetect, on MacOS, that one of the main differences with the original project.

@AlexSmirnov9107
Copy link

AlexSmirnov9107 commented May 6, 2024

you can remove: "opencvIncludeDir": "/opt/homebrew/Cellar/opencv/4.9.0_6/include/opencv4/", "opencvLibDir": "/opt/homebrew/Cellar/opencv/4.9.0_6/lib/", "opencvBinDir": "/opt/homebrew/Cellar/opencv/4.9.0_6/bin/"

homebrew's openCV is autodetect, on MacOS, that one of the main differences with the original project.

did not help

image

info config found opencv4nodejs section in /Users/alexandrsmirnov/Work/lombard-white/nestjs-lombard-terminal/package.json
info init no_autobuild is set.
info init 
info applyEnvsFromPackageJson the following opencv4nodejs environment variables are set in the package.json:

/Users/alexandrsmirnov/Work/lombard-white/nestjs-lombard-terminal/node_modules/@u4/opencv-build/script/deps/jsr.io/@std/fmt/0.223.0/colors.js:119
        ? `${code.open}${str.replace(code.regexp, code.open)}${code.close}`
                             ^
TypeError: str.replace is not a function
    at run (/Users/alexandrsmirnov/Work/lombard-white/nestjs-lombard-terminal/node_modules/@u4/opencv-build/script/deps/jsr.io/@std/fmt/0.223.0/colors.js:119:30)
    at Object.green (/Users/alexandrsmirnov/Work/lombard-white/nestjs-lombard-terminal/node_modules/@u4/opencv-build/script/deps/jsr.io/@std/fmt/0.223.0/colors.js:210:12)
    at formatNumber (/Users/alexandrsmirnov/Work/lombard-white/nestjs-lombard-terminal/node_modules/@u4/opencv-build/script/src/utils.js:67:43)
    at /Users/alexandrsmirnov/Work/lombard-white/nestjs-lombard-terminal/node_modules/@u4/opencv-build/script/src/OpenCVBuildEnv.js:396:161
    at Array.forEach (<anonymous>)
    at new OpenCVBuildEnv (/Users/alexandrsmirnov/Work/lombard-white/nestjs-lombard-terminal/node_modules/@u4/opencv-build/script/src/OpenCVBuildEnv.js:396:21)
    at new OpenCVBuilder (/Users/alexandrsmirnov/Work/lombard-white/nestjs-lombard-terminal/node_modules/@u4/opencv-build/script/src/OpenCVBuilder.js:75:24)
    at getOpenCV (/Users/alexandrsmirnov/Work/lombard-white/nestjs-lombard-terminal/node_modules/@u4/opencv4nodejs/cjs/lib/cvloader.js:40:21)
    at loadOpenCV (/Users/alexandrsmirnov/Work/lombard-white/nestjs-lombard-terminal/node_modules/@u4/opencv4nodejs/cjs/lib/opencv4nodejs.js:36:48)
    at Object.<anonymous> (/Users/alexandrsmirnov/Work/lombard-white/nestjs-lombard-terminal/node_modules/@u4/opencv4nodejs/cjs/lib/opencv4nodejs.js:58:14)

@AlexSmirnov9107
Copy link

i've figured out.
instead of

  "opencv4nodejs": {
    "disableAutoBuild": 1
  }

i made

  "opencv4nodejs": {
  "disableAutoBuild": "1"
}

replace number to string

@jay-gaojing
Copy link
Author

我已经弄清楚了。 代替

  "opencv4nodejs": {
    "disableAutoBuild": 1
  }

我做了

  "opencv4nodejs": {
  "disableAutoBuild": "1"
}

将数字替换为字符串

I tried to do that, but reported other errors
image

UrielCh added a commit to UrielCh/npm-opencv-build that referenced this issue May 7, 2024
@UrielCh
Copy link
Owner

UrielCh commented May 7, 2024

fixed in within @u4/opencv-build@1.0.1
thx for the report

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

3 participants