Opencv4nodejs: [Autobuild] Installation error on ubuntu18.04

Created on 8 Oct 2019  Â·  19Comments  Â·  Source: justadudewhohacks/opencv4nodejs

npm install --save opencv4nodejs

Error Message

info libs -Wl,-rpath,/home/ubu/node_modules/opencv-build/opencv/build/lib
info install spawning node gyp process: node-gyp rebuild --jobs max
make: Entering directory '/home/ubu/node_modules/opencv4nodejs/build'
  CXX(target) Release/obj.target/opencv4nodejs/cc/opencv4nodejs.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/CustomMatAllocator.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/ExternalMemTracking.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/core/core.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/core/coreConstants.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/core/Mat.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/core/Point.o
In file included from /home/ubu/node_modules/opencv-build/opencv/build/include/opencv2/ml.hpp:1967:0,
                 from ../cc/machinelearning/machinelearning.h:3,
                 from ../cc/opencv4nodejs.cc:25:
/home/ubu/node_modules/opencv-build/opencv/build/include/opencv2/ml/ml.inl.hpp: In function ‘int cv::ml::simulatedAnnealingSolver(SimulatedAnnealingSolverSystem&, double, double, double, size_t, double*, cv::RNG&)’:
/home/ubu/node_modules/opencv-build/opencv/build/include/opencv2/ml/ml.inl.hpp:55:0: note: -Wmisleading-indentation is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers
     return exchange;

  CXX(target) Release/obj.target/opencv4nodejs/cc/core/Vec.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/core/Size.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/core/Rect.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/core/RotatedRect.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/core/TermCriteria.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/imgproc/imgproc.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/imgproc/imgprocConstants.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/imgproc/MatImgproc.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/imgproc/Contour.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/imgproc/Moments.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/calib3d/calib3d.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/calib3d/calib3dConstants.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/calib3d/MatCalib3d.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/io/io.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/io/ioConstants.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/io/VideoCapture.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/io/VideoWriter.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/photo/photo.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/photo/photoConstants.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/photo/MatPhoto.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/video/video.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/video/BackgroundSubtractor.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/video/BackgroundSubtractorMOG2.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/video/BackgroundSubtractorKNN.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/ximgproc/ximgproc.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/ximgproc/MatXimgproc.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/ximgproc/SuperpixelSEEDS.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/ximgproc/SuperpixelSLIC.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/ximgproc/SuperpixelLSC.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/objdetect/objdetect.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/objdetect/CascadeClassifier.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/objdetect/HOGDescriptor.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/objdetect/DetectionROI.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/machinelearning/machinelearning.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/machinelearning/machinelearningConstants.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/machinelearning/ParamGrid.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/machinelearning/StatModel.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/machinelearning/SVM.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/machinelearning/TrainData.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/dnn/dnn.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/dnn/Net.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/face/face.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/face/FaceRecognizer.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/face/EigenFaceRecognizer.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/face/FisherFaceRecognizer.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/face/LBPHFaceRecognizer.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/face/Facemark.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/face/FacemarkAAM.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/face/FacemarkAAMData.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/face/FacemarkAAMParams.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/face/FacemarkLBF.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/face/FacemarkLBFParams.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/text/text.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/text/OCRHMMClassifier.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/text/OCRHMMDecoder.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/tracking/tracking.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/tracking/Tracker.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/tracking/MultiTracker.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/tracking/Trackers/TrackerBoosting.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/tracking/Trackers/TrackerBoostingParams.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/tracking/Trackers/TrackerKCF.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/tracking/Trackers/TrackerKCFParams.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/tracking/Trackers/TrackerMIL.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/tracking/Trackers/TrackerMILParams.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/tracking/Trackers/TrackerMedianFlow.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/tracking/Trackers/TrackerTLD.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/tracking/Trackers/TrackerGOTURN.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/tracking/Trackers/TrackerCSRT.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/tracking/Trackers/TrackerCSRTParams.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/tracking/Trackers/TrackerMOSSE.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/features2d.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/KeyPoint.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/KeyPointMatch.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/DescriptorMatch.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/BFMatcher.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/FeatureDetector.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/descriptorMatching.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/descriptorMatchingKnn.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/detectors/AGASTDetector.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/detectors/AKAZEDetector.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/detectors/BRISKDetector.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/detectors/FASTDetector.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/detectors/GFTTDetector.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/detectors/KAZEDetector.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/detectors/MSERDetector.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/detectors/ORBDetector.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/detectors/SimpleBlobDetector.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/features2d/detectors/SimpleBlobDetectorParams.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/xfeatures2d/xfeatures2d.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/xfeatures2d/SIFTDetector.o
  CXX(target) Release/obj.target/opencv4nodejs/cc/xfeatures2d/SURFDetector.o
  SOLINK_MODULE(target) Release/obj.target/opencv4nodejs.node
  COPY Release/opencv4nodejs.node
make: Leaving directory '/home/ubu/node_modules/opencv4nodejs/build'
ERR! In file included from /home/ubu/node_modules/opencv-build/opencv/build/include/opencv2/ml.hpp:1967:0,
                 from ../cc/machinelearning/machinelearning.h:3,
                 from ../cc/opencv4nodejs.cc:25:
/home/ubu/node_modules/opencv-build/opencv/build/include/opencv2/ml/ml.inl.hpp: In function ‘int cv::ml::simulatedAnnealingSolver(SimulatedAnnealingSolverSystem&, double, double, double, size_t, double*, cv::RNG&)’:
/home/ubu/node_modules/opencv-build/opencv/build/include/opencv2/ml/ml.inl.hpp:55:0: note: -Wmisleading-indentation is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers
     return exchange;


npm WARN saveError ENOENT: no such file or directory, open '/home/ubu/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/ubu/package.json'
npm WARN ubu No description
npm WARN ubu No repository field.
npm WARN ubu No README data
npm WARN ubu No license field.

+ [email protected]
updated 1 package and audited 227 packages in 160.367s
found 0 vulnerabilities

Auto Build - Full Error Log

opencv4nodejs-installation-log.txt

ubuntu 18.04, node 10.16.3 (npm 6.9.0)

Manual Build - Environment Information

Most helpful comment

Same error here, any advise?

All 19 comments

The same error if install opencv4nodejs with git

git clone https://github.com/justadudewhohacks/opencv4nodejs.git
cd opencv4nodejs
npm install

opencv4nodejs-git-installation-log.txt

@zi-l I have the same error. Have you solved it?

You have to install the package in a directory, where a package.json exists. Run npm init -y before installing the package or create an empty package.json.

@justadudewhohacks
I guess it's not related to package.json, since I had tried with the repository (refer to comment: install with git), which including a package.json in root dir.

Here are trials:

  • I've run npm init -y before npm install, it's not working, raising the same error.
  • I've created an empty package.json, run npm install --save opencv4nodejs, not works.
  • I've tried to switch python via update-alternatives between python2 and python3, not works.

The same
UBUNTU 18.04 x64
NPM 6.13.1
NODE 12.13.1

from sudo npm install --save opencv4nodejs

P.S.
python => Python 2.7.15+ (default, Oct 7 2019, 17:39:04)
python3 => Python 3.6.9 (default, Nov 7 2019, 10:44:02)
make => GNU Make 4.1

Same error here, any advise?

Did anyone solved this problem? Same error over here.

I have same error on lastest Ubuntu.

My rough guess for now is that g++ version matters.

@justadudewhohacks, what g++ version do you use?

The node version matters, I think, with the last version of node doesn't works for me, on the other hand with the v8.... Works!!

Modifying binding.gyp to disable the no-misleading-indentation warning worked for me.

The "cflags" section now reads

"cflags" : [
                        "-std=c++11",
                        "-Wno-misleading-indentation"
                ],

This seems to be the same issue as https://github.com/justadudewhohacks/opencv4nodejs/issues/649

CentOS 7 | 7.8.2003
gcc | 4.8.5-39.el7
gcc-c++ | 4.8.5-39.el7
devtoolset-7-gcc-c++ | 7.3.1-5.16.el7
nodejs| 10.20.1
node-gyp | 6.1.0
npm| 6.14.4
appium-doctor | 1.15.1
python | 2.7.5-88.el7
make | 3.82-24.el7

========
This is still happening to me as well.
I altered binding.gyp as per @hkozachkov2 , with same original outcome.

I'm not sure if I want to downgrade my node to version 8, in case it affects other elements for Appium deployment.

Anyone else found a solution as yet?

@chrischarles2002
I'm facing the same problem, the newest Appium does not support node<=8. And also openstf does not support node > 8

Would also appreciate a fix for this

I'm facing the same issue, any update of this?

Same issue here, working wrong with node version 12 (12.18.1), but working fine on node version 10 (10.16.3)

I'm facing the same issue.
Node version 14.4.0

+1

$ npm --version
3.5.2

$ nodejs --version
v8.10.0

$ g++ --version
g++ (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

As for misleading-indentation:

  CXX(target) Release/obj.target/opencv4nodejs/cc/core/Point.o
In file included from /usr/local/lib/node_modules/opencv4nodejs/node_modules/opencv-build/opencv/build/include/opencv2/ml.hpp:1967:0,
                 from ../cc/machinelearning/machinelearning.h:3,
                 from ../cc/opencv4nodejs.cc:25:
/usr/local/lib/node_modules/opencv4nodejs/node_modules/opencv-build/opencv/build/include/opencv2/ml/ml.inl.hpp: In function ‘int cv::ml::simulatedAnnealingSolver(SimulatedAnnealingSolverSystem&, double, double, double, size_t, double*, cv::RNG&)’:
/usr/local/lib/node_modules/opencv4nodejs/node_modules/opencv-build/opencv/build/include/opencv2/ml/ml.inl.hpp:55:0: note: -Wmisleading-indentation is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers
     return exchange;

Compile Error:

ERR! In file included from /usr/local/lib/node_modules/opencv4nodejs/node_modules/opencv-build/opencv/build/include/opencv2/ml.hpp:1967:0,
                 from ../cc/machinelearning/machinelearning.h:3,
                 from ../cc/opencv4nodejs.cc:25:
/usr/local/lib/node_modules/opencv4nodejs/node_modules/opencv-build/opencv/build/include/opencv2/ml/ml.inl.hpp: In function ‘int cv::ml::simulatedAnnealingSolver(SimulatedAnnealingSolverSystem&, double, double, double, size_t, double*, cv::RNG&)’:
/usr/local/lib/node_modules/opencv4nodejs/node_modules/opencv-build/opencv/build/include/opencv2/ml/ml.inl.hpp:55:0: note: -Wmisleading-indentation is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers
     return exchange;
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ShadabFaiz picture ShadabFaiz  Â·  7Comments

seanquijote picture seanquijote  Â·  6Comments

developer239 picture developer239  Â·  5Comments

SatoshiKawabata picture SatoshiKawabata  Â·  5Comments

pabx06 picture pabx06  Â·  4Comments