3 Replies Latest reply on Feb 29, 2016 7:51 AM by teambond1

    Failing to install opencv from package.json using npm install

    teambond1

      Is there a solution to this?

       

      So we get this following error when run the following command

       

      $ npm install opencv
      -
      > opencv@3.2.0 install /Applications/MAMP/htdocs/opencvTest/node_modules/opencv
      > node-pre-gyp install --fallback-to-build

        CXX(target) Release/obj.target/opencv/src/init.o
      In file included from ../src/init.cc:5:
      ../src/CascadeClassifierWrap.h:5:3: error: no type named 'CascadeClassifier' in namespace
        'cv'; did you mean 'CascadeClassifierWrap'?
        cv::CascadeClassifier cc;
        ^~~~~~~~~~~~~~~~~~~~~
        CascadeClassifierWrap
      ../src/CascadeClassifierWrap.h:3:7: note: 'CascadeClassifierWrap' declared here
      class CascadeClassifierWrap: public node::ObjectWrap {
        ^
      In file included from ../src/init.cc:6:
      ../src/VideoCaptureWrap.h:5:7: error: no type named 'VideoCapture' in namespace 'cv'; did
        you mean 'VideoCaptureWrap'?
        cv::VideoCapture cap;
        ^~~~~~~~~~~~~~~~
        VideoCaptureWrap
      ../src/VideoCaptureWrap.h:3:7: note: 'VideoCaptureWrap' declared here
      class VideoCaptureWrap: public node::ObjectWrap {
        ^
      In file included from ../src/init.cc:15:
      ../src/Stereo.h:8:5: error: no type named 'StereoBM' in namespace 'cv'; did you mean
        simply 'StereoBM'?
        cv::StereoBM stereo;
        ^~~~~~~~~~~~
        StereoBM
      ../src/Stereo.h:6:7: note: 'StereoBM' declared here
      class StereoBM: public node::ObjectWrap {
        ^
      ../src/Stereo.h:14:27: error: no member named 'StereoBM' in namespace 'cv'; did you mean
        simply 'StereoBM'?
        StereoBM(int preset = cv::StereoBM::BASIC_PRESET, int ndisparities = 0, int SA...
        ^~~~~~~~~~~~
        StereoBM
      ../src/Stereo.h:6:7: note: 'StereoBM' declared here
      class StereoBM: public node::ObjectWrap {
        ^
      ../src/Stereo.h:14:41: error: no member named 'BASIC_PRESET' in 'StereoBM'
        StereoBM(int preset = cv::StereoBM::BASIC_PRESET, int ndisparities = 0, int SA...
        ~~~~~~~~~~^
      ../src/Stereo.h:21:5: error: no type named 'StereoSGBM' in namespace 'cv'; did you mean
        simply 'StereoSGBM'?
        cv::StereoSGBM stereo;
        ^~~~~~~~~~~~~~
        StereoSGBM
      ../src/Stereo.h:19:7: note: 'StereoSGBM' declared here
      class StereoSGBM: public node::ObjectWrap {
        ^
      6 errors generated.
      make: *** [Release/obj.target/opencv/src/init.o] Error 1
      gyp ERR! build error
      gyp ERR! stack Error: `make` failed with exit code: 2
      gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
      gyp ERR! stack at ChildProcess.emit (events.js:98:17)
      gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
      gyp ERR! System Darwin 14.0.0
      gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--name=opencv" "--configuration=Release" "--module_name=opencv" "--version=3.2.0" "--major=3" "--minor=2" "--runtime=node" "--node_abi=node-v11" "--platform=darwin" "--target_platform=darwin" "--arch=x64" "--target_arch=x64" "--module_main=./lib/opencv" "--host=https://node-opencv.s3.amazonaws.com/" "--module_path=/Applications/MAMP/htdocs/opencvTest/node_modules/opencv/build/opencv/v3.2.0/Release/node-v11-darwin-x64" "--module=/Applications/MAMP/htdocs/opencvTest/node_modules/opencv/build/opencv/v3.2.0/Release/node-v11-darwin-x64/opencv.node" "--remote_path=./opencv/v3.2.0/Release/" "--package_name=node-v11-darwin-x64.tar.gz" "--staged_tarball=build/stage/opencv/v3.2.0/Release/node-v11-darwin-x64.tar.gz" "--hosted_path=https://node-opencv.s3.amazonaws.com/opencv/v3.2.0/Release/" "--hosted_tarball=https://node-opencv.s3.amazonaws.com/opencv/v3.2.0/Release/node-v11-darwin-x64.tar.gz"
      gyp ERR! cwd /Applications/MAMP/htdocs/opencvTest/node_modules/opencv
      gyp ERR! node -v v0.10.36
      gyp ERR! node-gyp -v v1.0.3
      gyp ERR! not ok
      node-pre-gyp ERR! build error
      node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp rebuild --name=opencv --configuration=Release --module_name=opencv --version=3.2.0 --major=3 --minor=2 --runtime=node --node_abi=node-v11 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./lib/opencv --host=https://node-opencv.s3.amazonaws.com/ --module_path=/Applications/MAMP/htdocs/opencvTest/node_modules/opencv/build/opencv/v3.2.0/Release/node-v11-darwin-x64 --module=/Applications/MAMP/htdocs/opencvTest/node_modules/opencv/build/opencv/v3.2.0/Release/node-v11-darwin-x64/opencv.node --remote_path=./opencv/v3.2.0/Release/ --package_name=node-v11-darwin-x64.tar.gz --staged_tarball=build/stage/opencv/v3.2.0/Release/node-v11-darwin-x64.tar.gz --hosted_path=https://node-opencv.s3.amazonaws.com/opencv/v3.2.0/Release/ --hosted_tarball=https://node-opencv.s3.amazonaws.com/opencv/v3.2.0/Release/node-v11-darwin-x64.tar.gz' (1)
      node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Applications/MAMP/htdocs/opencvTest/node_modules/opencv/node_modules/node-pre-gyp/lib/util/compile.js:76:29)
      node-pre-gyp ERR! stack at ChildProcess.emit (events.js:98:17)
      node-pre-gyp ERR! stack at maybeClose (child_process.js:766:16)
      node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:833:5)
      node-pre-gyp ERR! System Darwin 14.0.0
      node-pre-gyp ERR! command "node" "/Applications/MAMP/htdocs/opencvTest/node_modules/opencv/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
      node-pre-gyp ERR! cwd /Applications/MAMP/htdocs/opencvTest/node_modules/opencv
      node-pre-gyp ERR! node -v v0.10.36
      node-pre-gyp ERR! node-pre-gyp -v v0.5.31
      node-pre-gyp ERR! not ok
      Failed to execute 'node-gyp rebuild --name=opencv --configuration=Release --module_name=opencv --version=3.2.0 --major=3 --minor=2 --runtime=node --node_abi=node-v11 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./lib/opencv --host=https://node-opencv.s3.amazonaws.com/ --module_path=/Applications/MAMP/htdocs/opencvTest/node_modules/opencv/build/opencv/v3.2.0/Release/node-v11-darwin-x64 --module=/Applications/MAMP/htdocs/opencvTest/node_modules/opencv/build/opencv/v3.2.0/Release/node-v11-darwin-x64/opencv.node --remote_path=./opencv/v3.2.0/Release/ --package_name=node-v11-darwin-x64.tar.gz --staged_tarball=build/stage/opencv/v3.2.0/Release/node-v11-darwin-x64.tar.gz --hosted_path=https://node-opencv.s3.amazonaws.com/opencv/v3.2.0/Release/ --hosted_tarball=https://node-opencv.s3.amazonaws.com/opencv/v3.2.0/Release/node-v11-darwin-x64.tar.gz' (1)
      npm ERR! Darwin 14.0.0
      npm ERR! argv "node" "/usr/local/bin/npm" "install" "opencv"
      npm ERR! node v0.10.36
      npm ERR! npm v2.10.1
      npm ERR! code ELIFECYCLE

      npm ERR! opencv@3.2.0 install: `node-pre-gyp install --fallback-to-build`
      npm ERR! Exit status 1
      npm ERR!
      npm ERR! Failed at the opencv@3.2.0 install script 'node-pre-gyp install --fallback-to-build'.
      npm ERR! This is most likely a problem with the opencv package,
      npm ERR! not with npm itself.
      npm ERR! Tell the author that this fails on your system:
      npm ERR! node-pre-gyp install --fallback-to-build
      npm ERR! You can get their info via:
      npm ERR! npm owner ls opencv
      npm ERR! There is likely additional logging output above.

      npm ERR! Please include the following file with any support request:
      npm ERR! /Applications/MAMP/htdocs/opencvTest/npm-debug.log