opencv4nodejs
opencv4nodejs copied to clipboard
While trying to install opencv4nodejs "Error: no cmake vs compiler found for msversion: 4" error occuring
Error Message
Auto Build - Full Error Log
*OpenCV version = 3.4.6
*With OpenCV-contrib = No
Opencv4nodejs error.txt OS: 10
C:\Users\TestingAccount>npm i -g opencv4nodejs
[email protected] install C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs\node_modules\opencv-build node ./install.js
info install if you want to use an own OpenCV installation set OPENCV4NODEJS_DISABLE_AUTOBUILD
info readAutoBuildFile file does not exists: C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs\node_modules\opencv-build\opencv\auto-build.json C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs\node_modules\opencv-build\opencv\auto-build.json
info install failed to find auto-build.json: C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs\node_modules\opencv-build\opencv\auto-build.json
info install
info install running install script...
info install
info install opencv version: 3.4.6
info install with opencv contrib: yes
info install custom build flags:
info install
info install executing: git --version
info install git --version: git version 2.33.0.windows.2
info install
info install executing: cmake --version
info install cmake --version: cmake version 3.22.0
info install
info install CMake suite maintained and supported by Kitware (kitware.com/cmake).
info install
info find-msbuild failed to find vs2017 via powershell: Exception calling "Query" with "0" argument(s): "Retrieving the COM class factory for component with CLSID
info find-msbuild {177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D} failed due to the following error: 80040154 Class not registered (Exception
info find-msbuild from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))."
info find-msbuild At line:1 char:133
info find-msbuild + ... ncv-build\Find-VS2017.cs'; [VisualStudioConfiguration.Main]::Query()}
info find-msbuild + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
info find-msbuild + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
info find-msbuild + FullyQualifiedErrorId : COMException
info find-msbuild
info find-msbuild
info find-msbuild attempting to find msbuild via registry query...
info find-msbuild trying the following msbuild paths:
info find-msbuild version: 4, path: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
info install using msbuild: {
info install version: 4,
info install path: 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe'
info install }
ERR! Error: no cmake vs compiler found for msversion: 4
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node ./install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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\TestingAccount\AppData\Roaming\npm-cache_logs\2021-12-06T15_23_08_587Z-debug.log
C:\Users\TestingAccount>npm i -g opencv4nodejs
[email protected] install C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs\node_modules\opencv-build node ./install.js
info install if you want to use an own OpenCV installation set OPENCV4NODEJS_DISABLE_AUTOBUILD
info readAutoBuildFile file does not exists: C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs\node_modules\opencv-build\opencv\auto-build.json C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs\node_modules\opencv-build\opencv\auto-build.json
info install failed to find auto-build.json: C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs\node_modules\opencv-build\opencv\auto-build.json
info install
info install running install script...
info install
info install opencv version: 3.4.6
info install with opencv contrib: yes
info install custom build flags:
info install
info install executing: git --version
info install git --version: git version 2.33.0.windows.2
info install
info install executing: cmake --version
info install cmake --version: cmake version 3.22.0
info install
info install CMake suite maintained and supported by Kitware (kitware.com/cmake).
info install
info find-msbuild failed to find vs2017 via powershell: unexpected powershell output
info find-msbuild attempting to find msbuild via registry query...
info find-msbuild trying the following msbuild paths:
info find-msbuild version: 4, path: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
info install using msbuild: {
info install version: 4,
info install path: 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe'
info install }
ERR! Error: no cmake vs compiler found for msversion: 4
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node ./install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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\TestingAccount\AppData\Roaming\npm-cache_logs\2021-12-06T15_28_15_326Z-debug.log
Installed the Windows build tools and VS2017 AND 2015 VERSION
I was able to fix that by installing Microsoft Dot net run time 3.5.
After that below error occurs.
`nfo install '-DBUILD_opencv_reg=OFF', info install '-DBUILD_opencv_rgbd=OFF', info install '-DBUILD_opencv_saliency=OFF', info install '-DBUILD_opencv_shape=OFF', info install '-DBUILD_opencv_stereo=OFF', info install '-DBUILD_opencv_stitching=OFF', info install '-DBUILD_opencv_structured_light=OFF', info install '-DBUILD_opencv_superres=OFF', info install '-DBUILD_opencv_surface_matching=OFF', info install '-DBUILD_opencv_ts=OFF', info install '-DBUILD_opencv_xobjdetect=OFF', info install '-DBUILD_opencv_xphoto=OFF', info install '-DWITH_VTK=OFF', info install '-DOPENCV_ENABLE_NONFREE=ON', info install '-DOPENCV_EXTRA_MODULES_PATH=C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs\node_modules\opencv-build\opencv\opencv_contrib\modules' info install ] -- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.19042. CMake Error at CMakeLists.txt:135 (project): Failed to run MSBuild command:
C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/MSBuild/15.0/Bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 07-12-2021 12:50:05.
Project "C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs\node_modules\opencv-build\opencv\build\CMakeFiles\3.22.0\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs\node_modules\opencv-build\opencv\build\CMakeFiles\3.22.0\VCTargetsPath.vcxproj(15,2): error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs\node_modules\opencv-build\opencv\build\CMakeFiles\3.22.0\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs\node_modules\opencv-build\opencv\build\CMakeFiles\3.22.0\VCTargetsPath.vcxproj" (default target) (1) ->
C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs\node_modules\opencv-build\opencv\build\CMakeFiles\3.22.0\VCTargetsPath.vcxproj(15,2): error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.05
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/TestingAccount/AppData/Roaming/npm/node_modules/opencv4nodejs/node_modules/opencv-build/opencv/build/CMakeFiles/CMakeOutput.log".
ERR! child process exited with code 1 (for more info, set '--loglevel silly')
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node ./install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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\TestingAccount\AppData\Roaming\npm-cache_logs\2021-12-07T07_20_08_562Z-debug.log
C:\Users\TestingAccount> `
It is something related to .NET stuff, I had this error on my PC. Then I switched to my laptop(everything is fresh installed), then I got rid of this error. Now I got into this #833.
Hi,
My fork use a different method to detect Visual Studio
see findMsBuild.ts you can try it from here