justadudewhohacks / npm-opencv-build

A simple script to auto build recent OpenCV + contrib version via npm
44 stars 57 forks source link

I have already brew uninstall tesseract,but when I npm install opencv-build ,still failed #49

Open 6ququ6 opened 3 years ago

6ququ6 commented 3 years ago

I have already brew uninstall tesseract,but when I npm install opencv-build ,still failed. here is the log: [ 78%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/tensorflow/tf_importer.cpp.o [ 78%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/tensorflow/tf_io.cpp.o [ 78%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/torch/THDiskFile.cpp.o [ 79%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/torch/THFile.cpp.o [ 79%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/torch/THGeneral.cpp.o [ 79%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/torch/torch_importer.cpp.o [ 79%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/layers/layers_common.avx.cpp.o [ 79%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/layers/layers_common.avx2.cpp.o [ 79%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/layers/layers_common.avx512_skx.cpp.o [ 79%] Linking CXX shared library ../../lib/libopencv_dnn.dylib [ 79%] Built target opencv_dnn make: *** [all] Error 2 ERR! child process exited with code 2 (for more info, set '--loglevel silly') npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! opencv-build@0.1.9 install:node ./install.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the opencv-build@0.1.9 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/sitan/.npm/_logs/2021-09-08T05_17_13_784Z-debug.log sitandeMacBook-Pro:~ xxx$ brew unlink tesseract Error: No such keg: /opt/homebrew/Cellar/tesseract` image

RriwYFQkOc commented 2 years ago

I found that this keeps failing is because of opencv_contrib-3.4.6. It can be solved by updating the source to be opencv_contrib-4.5.4

in env.js,

function opencvVersion() {
  return '4.5.4';
}

in constant.js and constant.d.ts,

OPENCV_CONTRIB_ARCHIVE = "https ... 4.5.4.tar.gz";

Build it manually. Hopefully this will work for you.