Open zi-l opened 4 years ago
The same error if install opencv4nodejs
with git
git clone https://github.com/justadudewhohacks/opencv4nodejs.git
cd opencv4nodejs
npm install
@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:
npm init -y
before npm install
, it's not working, raising the same error.package.json
, run npm install --save opencv4nodejs
, not works.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;
After a huge huge number of failures, in installing opencv4nodejs, i downgraded versions and tried installing it, for a temporary resolution. I have been facing the same issue from few days "missing indentation in ml.hpp" , finally the compile error disappeared, then the cmake error. It was a huge relief. Now I'm successfully able to use web camera in express.js. These are the versions i added in package.json. Make sure you delete package-lock.json and node-modules directory in your root folder. In package.json, add these versions.
`"express": "^4.16.3",
"express-fileupload": "^1.2.1",
"opencv4nodejs": "^4.7.3",
"socket.io": "^2.1.1"
steps : npm init -y ; rm -rf node_modules package-lock.json ; npm install (assuming you have package.json)
Note : This is only a temporary fix to quickly get started with opencv4nodejs. If you need higher versions, I'm not sure. I have been facing issue with 5.1 version and above.
Successful installation :
CXX(target) Release/obj.target/opencv4nodejs/cc/modules/features2d/detectors/ORBDetector.o
CXX(target) Release/obj.target/opencv4nodejs/cc/modules/features2d/detectors/SimpleBlobDetector.o
CXX(target) Release/obj.target/opencv4nodejs/cc/modules/features2d/detectors/SimpleBlobDetectorParams.o
CXX(target) Release/obj.target/opencv4nodejs/cc/modules/xfeatures2d/xfeatures2d.o
CXX(target) Release/obj.target/opencv4nodejs/cc/modules/xfeatures2d/SIFTDetector.o
CXX(target) Release/obj.target/opencv4nodejs/cc/modules/xfeatures2d/SURFDetector.o
SOLINK_MODULE(target) Release/obj.target/opencv4nodejs.node
COPY Release/opencv4nodejs.node
make: Leaving directory '/home/priya/expressapp/browse_try/node_modules/opencv4nodejs/build'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN expressapp@1.0.0 No repository field.
added 136 packages from 116 contributors and audited 136 packages in **748.026s**
found 0 vulnerabilities
All the best .
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 #649
不知道在哪里设置这个,但是我导入环境变量就可以正常完成了:
export CXXFLAGS="-std=c++14 -Wno-c++11-narrowing -Wno-misleading-indentation"
希望对大家有所帮助~
另外安装过程中遇到的其他问题
异常 npm ERR! throw new Error('library dir does not exist: ' + libDir)
尝试将nodejs版本降至v14.19.3 添加以下内容到package.json "opencv4nodejs": { "opencvIncludeDir": "/usr/local/Cellar/opencv/4.5.5_2/include", "opencvLibDir": "/usr/local/Cellar/opencv/4.5.5_2/lib", "opencvBinDir": "/usr/local/Cellar/opencv/4.5.5_2/bin" }
另外如果安装到ffmpeg报错,可以尝试卸载本地的ffmpeg再安装
Error Message
Auto Build - Full Error Log
opencv4nodejs-installation-log.txt
ubuntu 18.04
,node 10.16.3 (npm 6.9.0)
Manual Build - Environment Information