justadudewhohacks/opencv4nodejs

Install failing at 55% MacOS Monterey

Pranushan157 opened this issue · 2 comments

Error Message

[ 55%] Linking CXX shared library ../../lib/libopencv_core.dylib
[ 55%] Built target opencv_core
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/pranushannimalan/.npm/_logs/2022-10-13T15_37_03_754Z-debug.log

Auto Build - Full Error Log

error.txt

Manual Build - Environment Information

OpenCV version (example 3.4.1): 3.4.6

With OpenCV-contrib? (extra modules): no

OS: MacOS Monterey

opencv-build seems not working well with macOS (on M1-powered mac it fails on library not found for -lfreetype even if freetype is installed), so my solution was to install OpenCV manually (via Brew) and point opencv4nodejs to it (opencv-build should be removed):

"opencv4nodejs": {
    "opencvLibDir": "/opt/homebrew/Cellar/opencv/4.6.0_1/lib",
    "opencvBinDir": "/opt/homebrew/Cellar/opencv/4.6.0_1/bin",
    "opencvIncludeDir": "/opt/homebrew/Cellar/opencv/4.6.0_1/bin",
    "disableAutoBuild": true
},

This repository is not maintained anymore, please use @u4/opencv4nodejs for a more active fork