Skip to content

Instantly share code, notes, and snippets.

@adwellj
Last active January 28, 2023 09:52
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adwellj/61e7f202bcfe5b96f312293e9c812ca6 to your computer and use it in GitHub Desktop.
Save adwellj/61e7f202bcfe5b96f312293e9c812ca6 to your computer and use it in GitHub Desktop.
Windows Global Install for opencv4nodejs

Installation

Start with node-gyp

You can install with npm:

$ npm install -g node-gyp

You will also need to install:

On Windows

Option 1 (what I've used)

From an elevated PowerShell or CMD.exe (run as Administrator), install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools.

If you already have Visual Studio installed, then Visual Studio Build Tools may fail. In that case launch cmd and enter npm config set msvs_version 2017.

Option 2

Install tools and configuration manually:

  • Install Visual C++ Build Environment: Visual Studio Build Tools (using "Visual C++ build tools" workload) or Visual Studio 2017 Community (using the "Desktop development with C++" workload)
  • Install Python 2.7 (v3.x.x is not supported), and run npm config set python python2.7 (or see below for further instructions on specifying the proper Python version and path.)
  • Launch cmd, npm config set msvs_version 2017

If the above steps didn't work for you, please visit Microsoft's Node.js Guidelines for Windows for additional tips.

If you have multiple Python versions installed, you can identify which Python version node-gyp uses by setting the '--python' variable:

$ node-gyp --python /path/to/python2.7

If node-gyp is called by way of npm, and you have multiple versions of Python installed, then you can set npm's 'python' config key to the appropriate value:

$ npm config set python /path/to/executable/python2.7

If windows-build-tools was installed, the Python 2.7 path should be C:\Users\<user>\.windows-build-tools\python27\.

Use the command below to check npm's 'python' config key value:

$ npm config get python

Install CMake

Download and install x64 version from: CMake Downloads

Add to PATH during install

Will need to execute remaining commands in new terminal for cmake to be recognized. Use cmake --version to confirm that it's installed and available.


Install opencv4nodejs:

Auto build

Verify that git is installed by using git --version; install if necessary.

If you do not want to set up OpenCV on your own you can simply let this package auto install OpenCV 3.4 + OpenCV contrib 3.4 (might take some time):

$ npm i -g opencv4nodejs

I've gotten errors about Visual Studio on a clean install (using just the windows-build-tools; not Visual Studio), and resolved that with a restart. I had also installed Visual Studio Build Tools, but the restart might have been all that was needed.

In order to prevent build errors during an npm install, your package.json should not include opencv4nodejs, and instead should include/require the global package either by requiring it by absolute path or setting the NODE_PATH environment variable to /usr/lib/node_modules in your Dockerfile and requiring the package as you normally would.

I chose to add a NODE_PATH environment variable. The install path will be displayed in the output of the previous command, but for me it was in C:\Users\<user>\AppData\Roaming\npm\node_modules.

@nikolahua
Copy link

Thank you very much, it helps a lot!! Now I successfully global installed opencv4nodejs with npm, and know how to require it in my code.

@adwellj
Copy link
Author

adwellj commented Jun 28, 2019

@huahaofeng, I'm glad it helped :)

@hAbd0u
Copy link

hAbd0u commented Jul 2, 2019

Following your steps reduced some errors I was getting but still this s not fixed:


> opencv4nodejs@5.1.0 install m:\taxi-detector\node_modules\opencv4nodejs
> node-gyp rebuild --jobs max


m:\taxi-detector\node_modules\opencv4nodejs>if not defined npm_config_node_gyp (node "C:\Users\Mr B\AppData\Roaming\npm\node_modules\npm\nod
e_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild --jobs max )  else (node "C:\Users\Mr B\AppData\R
oaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild --jobs max )
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(374,5): warning MSB8003:
 Could not find VCToolsInstallDir variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid version n
umber. [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
cl : Command line warning D9002: ignoring unknown option '/diagnostics:classic' [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4n
odejs.vcxproj]
cl : Command line warning D9002: ignoring unknown option '/diagnostics:classic' [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4n
odejs.vcxproj]
  opencv4nodejs.cc
cl : Command line warning D9002: ignoring unknown option '/diagnostics:classic' [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4n
odejs.vcxproj]
  CustomMatAllocator.cc
cl : Command line warning D9002: ignoring unknown option '/diagnostics:classic' [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4n
odejs.vcxproj]
  ExternalMemTracking.cc
cl : Command line warning D9002: ignoring unknown option '/diagnostics:classic' [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4n
odejs.vcxproj]
cl : Command line warning D9002: ignoring unknown option '/diagnostics:classic' [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4n
odejs.vcxproj]
  core.cc
cl : Command line warning D9002: ignoring unknown option '/diagnostics:classic' [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4n
odejs.vcxproj]
cl : Command line warning D9002: ignoring unknown option '/diagnostics:classic' [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4n
odejs.vcxproj]
  coreConstants.cc
cl : Command line warning D9002: ignoring unknown option '/diagnostics:classic' [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4n
odejs.vcxproj]
  Mat.cc
cl : Command line warning D9002: ignoring unknown option '/diagnostics:classic' [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4n
odejs.vcxproj]
cl : Command line warning D9002: ignoring unknown option '/diagnostics:classic' [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4n
odejs.vcxproj]
cl : Command line warning D9002: ignoring unknown option '/diagnostics:classic' [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4n
odejs.vcxproj]
  Point.cc
  Vec.cc
cl : Command line warning D9002: ignoring unknown option '/diagnostics:classic' [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4n
odejs.vcxproj]
  Size.cc
  Rect.cc
  RotatedRect.cc
  TermCriteria.cc
c:\program files (x86)\windows kits\10\include\10.0.17763.0\ucrt\corecrt.h(10): fatal error C1083: Cannot open include file: 'vcruntime.h':
 No such file or directory (compiling source file ..\cc\opencv4nodejs.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.
vcxproj]
  imgproc.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\ExternalMemTracking.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\opencv4nodejs\cc\custommatallocator.h(4): fatal error C1083: Cannot open include file: 'thread': No such file
 or directory (compiling source file ..\cc\CustomMatAllocator.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  imgprocConstants.cc
  MatImgproc.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\core\Mat.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\core\Point.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\core\core.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\core\coreConstants.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
e:\downloads\programs\opencv\build\include\opencv2\core\cvdef.h(164): fatal error C1083: Cannot open include file: 'limits.h': No such file
 or directory (compiling source file ..\cc\core\TermCriteria.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\core\RotatedRect.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
e:\downloads\programs\opencv\build\include\opencv2\core\cvdef.h(164): fatal error C1083: Cannot open include file: 'limits.h': No such file
 or directory (compiling source file ..\cc\core\Rect.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
e:\downloads\programs\opencv\build\include\opencv2\core\cvdef.h(164): fatal error C1083: Cannot open include file: 'limits.h': No such file
 or directory (compiling source file ..\cc\core\Size.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  Contour.cc
  Moments.cc
  calib3d.cc
  calib3dConstants.cc
  MatCalib3d.cc
  io.cc
  ioConstants.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\core\Vec.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  VideoCapture.cc
  VideoWriter.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\imgproc\MatImgproc.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  photo.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\imgproc\imgproc.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  photoConstants.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\imgproc\Contour.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\imgproc\Moments.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  video.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\calib3d\calib3d.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\imgproc\imgprocConstants.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  BackgroundSubtractor.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\io\VideoCapture.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\io\io.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  BackgroundSubtractorMOG2.cc
  BackgroundSubtractorKNN.cc
  ximgproc.cc
  MatXimgproc.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\io\VideoWriter.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\io\ioConstants.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\calib3d\MatCalib3d.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  SuperpixelSEEDS.cc
  SuperpixelSLIC.cc
  SuperpixelLSC.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\calib3d\calib3dConstants.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  objdetect.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\photo\photoConstants.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  CascadeClassifier.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\video\BackgroundSubtractor.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\video\BackgroundSubtractorMOG2.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxp
roj]
  HOGDescriptor.cc
  DetectionROI.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\video\BackgroundSubtractorKNN.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxpr
oj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\ximgproc\MatXimgproc.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\video\video.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  machinelearning.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\photo\photo.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  machinelearningConstants.cc
  ParamGrid.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\ximgproc\ximgproc.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  StatModel.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\ximgproc\SuperpixelSLIC.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  SVM.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\objdetect\objdetect.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  TrainData.cc
  dnn.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\ximgproc\SuperpixelLSC.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  Net.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\ximgproc\SuperpixelSEEDS.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  face.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\objdetect\CascadeClassifier.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj
]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\objdetect\DetectionROI.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  FaceRecognizer.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\objdetect\HOGDescriptor.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  EigenFaceRecognizer.cc
  FisherFaceRecognizer.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\machinelearning\machinelearningConstants.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4n
odejs.vcxproj]
  LBPHFaceRecognizer.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\machinelearning\SVM.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\machinelearning\machinelearning.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcx
proj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\machinelearning\StatModel.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  Facemark.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\machinelearning\ParamGrid.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  FacemarkAAM.cc
  FacemarkAAMData.cc
  FacemarkAAMParams.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\machinelearning\TrainData.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\dnn\dnn.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\dnn\Net.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  FacemarkLBF.cc
  FacemarkLBFParams.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\face\face.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  text.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\face\FaceRecognizer.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  OCRHMMClassifier.cc
  OCRHMMDecoder.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\face\EigenFaceRecognizer.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  tracking.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\face\FisherFaceRecognizer.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  Tracker.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\face\FacemarkAAMData.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\face\FacemarkAAM.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  MultiTracker.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\face\Facemark.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\face\FacemarkAAMParams.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  TrackerBoosting.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\face\FacemarkLBF.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\face\LBPHFaceRecognizer.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  TrackerBoostingParams.cc
  TrackerKCF.cc
  TrackerKCFParams.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\face\FacemarkLBFParams.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  TrackerMIL.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\text\text.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  TrackerMILParams.cc
  TrackerMedianFlow.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\text\OCRHMMClassifier.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  TrackerTLD.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\text\OCRHMMDecoder.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\tracking\tracking.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  TrackerGOTURN.cc
  TrackerCSRT.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\tracking\MultiTracker.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  TrackerCSRTParams.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\tracking\Trackers\TrackerKCF.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxpro
j]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\tracking\Trackers\TrackerKCFParams.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.
vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\tracking\Trackers\TrackerBoostingParams.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4no
dejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\tracking\Tracker.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  TrackerMOSSE.cc
  features2d.cc
  KeyPoint.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\tracking\Trackers\TrackerBoosting.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.v
cxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\tracking\Trackers\TrackerMIL.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxpro
j]
  KeyPointMatch.cc
  DescriptorMatch.cc
  BFMatcher.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\tracking\Trackers\TrackerMILParams.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.
vcxproj]
  FeatureDetector.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\tracking\Trackers\TrackerMedianFlow.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs
.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\tracking\Trackers\TrackerTLD.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxpro
j]
  descriptorMatching.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\tracking\Trackers\TrackerGOTURN.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcx
proj]
  descriptorMatchingKnn.cc
  AGASTDetector.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\tracking\Trackers\TrackerCSRT.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxpr
oj]
  AKAZEDetector.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\tracking\Trackers\TrackerMOSSE.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxp
roj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\tracking\Trackers\TrackerCSRTParams.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs
.vcxproj]
  BRISKDetector.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\KeyPoint.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  FASTDetector.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\KeyPointMatch.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  GFTTDetector.cc
  KAZEDetector.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\DescriptorMatch.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\BFMatcher.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  MSERDetector.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\FeatureDetector.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  ORBDetector.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\features2d.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
  SimpleBlobDetector.cc
  SimpleBlobDetectorParams.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\descriptorMatching.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxpr
oj]
  xfeatures2d.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\detectors\AKAZEDetector.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.
vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\detectors\AGASTDetector.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.
vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\descriptorMatchingKnn.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vc
xproj]
  SIFTDetector.cc
  SURFDetector.cc
  win_delay_load_hook.cc
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\detectors\BRISKDetector.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.
vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\detectors\KAZEDetector.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.v
cxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\detectors\FASTDetector.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.v
cxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\detectors\GFTTDetector.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.v
cxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\detectors\MSERDetector.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.v
cxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\detectors\SimpleBlobDetectorParams.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\ope
ncv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\detectors\SimpleBlobDetector.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4no
dejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\features2d\detectors\ORBDetector.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vc
xproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\xfeatures2d\xfeatures2d.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\xfeatures2d\SURFDetector.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
m:\taxi-detector\node_modules\native-node-utils\src\utils.h(1): fatal error C1083: Cannot open include file: 'memory': No such file or dire
ctory (compiling source file ..\cc\xfeatures2d\SIFTDetector.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\windows.h(167): fatal error C1083: Cannot open include file: 'excpt.h': No s
uch file or directory (compiling source file C:\Users\Mr B\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\src\win_delay_load_ho
ok.cc) [m:\taxi-detector\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\Mr B\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Mr B\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\b
in\\node-gyp.js" "rebuild" "--jobs" "max"
gyp ERR! cwd m:\taxi-detector\node_modules\opencv4nodejs
gyp ERR! node -v v8.11.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'm:\taxi-detector\package.json'
npm WARN taxi-detector No description
npm WARN taxi-detector No repository field.
npm WARN taxi-detector No README data
npm WARN taxi-detector No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! opencv4nodejs@5.1.0 install: `node-gyp rebuild --jobs max`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the opencv4nodejs@5.1.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Mr B\AppData\Roaming\npm-cache\_logs\2019-07-02T21_29_23_569Z-debug.log```

@adwellj
Copy link
Author

adwellj commented Jul 3, 2019

@hAbd0u, I'm sorry to hear that. I'm not involved with opencv4nodejs, so you might try posting on that repo if you're looking for help. I created this document mostly to help me recall my steps for installation.

@hAbd0u
Copy link

hAbd0u commented Jul 3, 2019

@adwellj, Thank you for the post, that already was enough to me.
After days of goofling it turns out that opencv4nodejs can be compiled with VC2015 better, and if you have already VC2017 community installed which is already has VC2015 included but it seems broken as the other forum members mentioned, so what it does work for me eventually this:

npm install windows-build-tools --vs2015
npm install --prefer-offline  --vs2015  --save opencv4nodejs

@nikolahua
Copy link

@hAbd0u, try the manual way of installation which is much easier on windows.

installing-opencv-manually

  1. install opencv release, which can be found here, the version I used is 3.4.x
  2. disable auto build
OPENCV4NODEJS_DISABLE_AUTOBUILD=1
  1. set system environmental variables

TIM截图20190704100631

  1. npm install opencv4nodejs
  2. or npm install opencv4nodejs -g for global installation, and NODE_PATH should be added to system environmental variables

@femto11
Copy link

femto11 commented Aug 8, 2019

Because I had problems getting my electron app running (it comlained about a module not being found in the temp folder although it was there), I also tried to manually install opencv and disable auto build as described here. The app is working now but only on my dev machine where opencv is installed. It seems like that electron builder did not move these dependencies into the packaged app. What I'm doing wrong here?

@adwellj
Copy link
Author

adwellj commented Aug 8, 2019

@femto11, I'm sorry to hear that. I'm not involved with opencv4nodejs, so you might try posting on that repo if you're looking for help. I created this document mostly to help me recall my steps for installation.

Unsure if it helps, but there is a section in the README for Usage with Electron.

@Kwaiyu
Copy link

Kwaiyu commented Jul 4, 2021

Regardless of manual or automatic construction, when the curl network is not good, the file size is 0, try to add raw.githubusercontent.com to the proxy rules to continue curl, otherwise manually download the file to the directory:

#!/bin/bash
cd ./cache/xfeatures2d/
cd boostdesc
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_lbgm.i> 0ae0675534aa318d9668f2a179c2a052-boostdesc_lbgm.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_256.i> e6dcfa9f647779eb1ce446a8d759b6ea-boostdesc_binboost_256.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_128.i> 98ea99d399965c03d555cef3ea502a0b-boostdesc_binboost_128.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_064.i> 202e1b3e9fec871b04da31f7f016679f-boostdesc_binboost_064.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm_hd.i> 324426a24fa56ad9c5b8e3e0b3e5303e-boostdesc_bgm_hd.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm_bi.i> 232c966b13651bd0e46a1497b0852191-boostdesc_bgm_bi.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm.i> 0ea90e7a8f3f7876d450e4149c97c74f-boostdesc_bgm.i
cd ../vgg
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_120.i> 151805e03568c9f490a5e3a872777b75-vgg_generated_120.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_64.i> 7126a5d9a8884ebca5aea5d63d677225-vgg_generated_64.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_48.i> e8d0dcd54d1bcfdc29203d011a797179-vgg_generated_48.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_80.i> 7cd47228edec52b6d82f46511af325c5-vgg_generated_80.i

Add these files to the “npm\node_modules\opencv4nodejs\node_modules\opencv-build\opencv\opencv_contrib\modules\xfeatures2d\src" folder if cache not available

@Shiju94253
Copy link

Shiju94253 commented Sep 29, 2022

Hi need help, I am new to testing and trying to work with Appium. When I run appium doctor I am getting the following result, kindly advice:
Kindly help me with "opencv4nodejs cannot be found." I am using Windows 11.
C:\Users\nshij>appium-doctor
WARN AppiumDoctor [Deprecated] Please use appium-doctor installed with "npm install @appium/doctor --location=global"
info AppiumDoctor Appium Doctor v.1.16.2
info AppiumDoctor ### Diagnostic for necessary dependencies starting ###
info AppiumDoctor ✔ The Node.js binary was found at: C:\Program Files\nodejs\node.EXE
info AppiumDoctor ✔ Node version is 18.9.1
info AppiumDoctor ✔ ANDROID_HOME is set to: C:\Users\nshij\AppData\Local\Android\Sdk
info AppiumDoctor ✔ JAVA_HOME is set to: C:\Program Files\Java\jdk-19
info AppiumDoctor Checking adb, android, emulator, apkanalyzer.bat
info AppiumDoctor 'adb' is in C:\Users\nshij\AppData\Local\Android\Sdk\platform-tools\adb.exe
info AppiumDoctor 'android' is in C:\Users\nshij\AppData\Local\Android\Sdk\tools\android.bat
info AppiumDoctor 'emulator' is in C:\Users\nshij\AppData\Local\Android\Sdk\emulator\emulator.exe
info AppiumDoctor 'apkanalyzer.bat' is in C:\Users\nshij\AppData\Local\Android\Sdk\cmdline-tools\latest\bin\apkanalyzer.bat
info AppiumDoctor ✔ adb, android, emulator, apkanalyzer.bat exist: C:\Users\nshij\AppData\Local\Android\Sdk
info AppiumDoctor ✔ 'bin' subfolder exists under 'C:\Program Files\Java\jdk-19'
info AppiumDoctor ### Diagnostic for necessary dependencies completed, no fix needed. ###
info AppiumDoctor
info AppiumDoctor ### Diagnostic for optional dependencies starting ###
WARN AppiumDoctor ✖ opencv4nodejs cannot be found.
info AppiumDoctor ✔ ffmpeg is installed at: C:\Program Files\ffmpeg\ffmpeg-5.1.2-essentials_build\bin\ffmpeg.EXE. ffmpeg version 5.1.2-essentials_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
info AppiumDoctor ✔ mjpeg-consumer is installed at: C:\Users\nshij\AppData\Roaming\npm. Installed version is: 2.0.0
info AppiumDoctor ✔ bundletool.jar is installed at: C:\Users\nshij\AppData\Local\Android\Sdk\bundle-tools\bundletool.jar
info AppiumDoctor ✔ gst-launch-1.0.exe and gst-inspect-1.0.exe are installed at: D:\gstreamer\1.0\msvc_x86_64\bin\gst-launch-1.0.exe and D:\gstreamer\1.0\msvc_x86_64\bin\gst-inspect-1.0.exe
info AppiumDoctor ### Diagnostic for optional dependencies completed, one fix possible. ###
info AppiumDoctor
info AppiumDoctor ### Optional Manual Fixes ###
info AppiumDoctor The configuration can install optionally. Please do the following manually:
WARN AppiumDoctor ➜ Why opencv4nodejs is needed and how to install it: http://appium.io/docs/en/writing-running-appium/image-comparison/
info AppiumDoctor
info AppiumDoctor ###
info AppiumDoctor
info AppiumDoctor Bye! Run appium-doctor again when all manual fixes have been applied!

@adwellj
Copy link
Author

adwellj commented Sep 29, 2022

@Shiju94253, I'm not involved in this project; this is just a document I created a few years ago to help me recall my steps for installation. It's likely outdated at this point for various reasons. I would suggest going to the opencv4nodejs repo and checking there for help

I assume you tried the installation instructions below found in the link in the warning:
npm i -g opencv4nodejs

@Shiju94253
Copy link

Hi adwellj, tried all methods, was able to fix other otional dependencies like : ffmpeg, mjpeg,bundletool and gst, but I am unable to install opencv4nodejs. Kindly guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment