Open MarkKocherovsky opened 3 years ago
I've got the same issue. I'm on Ubuntu and I've built and installed opencv from source according to their instructions. Can't install this package though. Any updates/solutions on this issue? TIA.
I am not sure where the problem is, but the way this library is looking to find opencv is not working.
opencv4 is what is present. looking at this script, setting this env variable (PKG_CONFIG_OPENCV4=1) can force this module to look for opencv4. That got me past the npm installation.
I am not sure where the problem is, but the way this library is looking to find opencv is not working.
opencv4 is what is present. looking at this script, setting this env variable (PKG_CONFIG_OPENCV4=1) can force this module to look for opencv4. That got me past the npm installation.
Using this got me up to here:
npm ERR! code 1
npm ERR! path /Users/jackyalcine/Projects/vita-min/node_modules/opencv
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! CXX(target) Release/obj.target/opencv/src/init.o
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.3.1
npm ERR! gyp info using node@18.16.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.11.4 found at "/opt/homebrew/opt/python@3.11/bin/python3.11"
npm ERR! gyp info spawn /opt/homebrew/opt/python@3.11/bin/python3.11
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/opt/homebrew/Cellar/node@18/18.16.0_1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/jackyalcine/Projects/vita-min/node_modules/opencv/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/opt/homebrew/Cellar/node@18/18.16.0_1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/jackyalcine/Library/Caches/node-gyp/18.16.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/jackyalcine/Library/Caches/node-gyp/18.16.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/opt/homebrew/Cellar/node@18/18.16.0_1/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/jackyalcine/Library/Caches/node-gyp/18.16.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/jackyalcine/Projects/vita-min/node_modules/opencv',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/init.cc:1:
npm ERR! In file included from ../src/OpenCV.h:18:
npm ERR! In file included from /Users/jackyalcine/Library/Caches/node-gyp/18.16.0/include/node/v8.h:24:
npm ERR! In file included from /Users/jackyalcine/Library/Caches/node-gyp/18.16.0/include/node/v8-array-buffer.h:12:
npm ERR! In file included from /Users/jackyalcine/Library/Caches/node-gyp/18.16.0/include/node/v8-local-handle.h:12:
npm ERR! /Users/jackyalcine/Library/Caches/node-gyp/18.16.0/include/node/v8-internal.h:646:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ~~~~~^~~~~~~~~~~
npm ERR! remove_cv
npm ERR! /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/remove_cv.h:22:50: note: 'remove_cv' declared here
npm ERR! template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
npm ERR! ^
npm ERR! ../src/init.cc:23:9: warning: Building with OpenCV4.7 [-W#pragma-messages]
npm ERR! #pragma message ( "Building with OpenCV" STR(CV_MAJOR_VERSION) "." STR(CV_MINOR_VERSION) )
npm ERR! ^
npm ERR! 1 warning and 1 error generated.
npm ERR! make: *** [Release/obj.target/opencv/src/init.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 (/opt/homebrew/Cellar/node@18/18.16.0_1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 22.5.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node@18/18.16.0_1/bin/node" "/opt/homebrew/Cellar/node@18/18.16.0_1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/jackyalcine/Projects/vita-min/node_modules/opencv
npm ERR! gyp ERR! node -v v18.16.0
npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! gyp ERR! not ok
Describe the bug When running
sudo npm i opencv
, I get the following error:I have
pkg-config
installed. I also have opencv installed on windows, added to my PATH and my new system variable, and the git is cloned in my project directory. I'm currently running npm 7.6.0 on the Ubuntu 20.04 terminal for windows 10.To Reproduce Follow the windows instructions here and run
sudo npm i opencv
in the project directory. Expected behavior Should Install opencv js with no errors.OS / Libraries
Additional context
If I run
apt list | grep opencv
, the following is returned: