node-opencv
node-opencv copied to clipboard
[BUG] Unable to install on MacOS BigSur 12.2.3
Describe the bug I am trying to install this library on MacOS BigSur 12.2.3 for a proof of concept, however the installation crashes with too many errors (literally)
To Reproduce Steps to reproduce the behavior:
Install opencv as suggested
brew install pkg-config
brew install opencv@2
brew link --force opencv@2
I move to the project
npm init
npm i opencv
Expected behavior The package should be installed in the project
OS / Libraries
- MacOS BigSur 12.2.3 running on Intel i5 8257u (NOT M1)
- OpenCV Version: opencv@2 2.4.13.7_11
Additional context
This should give an idea of the complexity of the situation. Complete logfile attached for clarity
npm ERR! fatal error: too many errors emitted, stopping now [-ferror-limit=]
npm ERR! 20 errors generated.
npm ERR! make: *** [Release/obj.target/opencv/src/Matrix.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:315:20)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
npm ERR! gyp ERR! System Darwin 20.3.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/gabriel/dev/cat_haar_poc/node_modules/opencv
npm ERR! gyp ERR! node -v v14.16.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
I will attach the complete logfile since it is too complex for me to dissect 2021-04-08T16_51_14_011Z-debug.log
After downgrading node from v14 to v12 as suggested by @zacherkkila on another issue, the installation works. So the problem seems to be with node v14
Same thing with node v16. It seems that many changes occurred with v8 between those two versions, and it's affecting the building for newer versions.
Also, can't stop noticing that in node v12 there's a lot of warning, mainly deprecation notices. Maybe that's related.