Opencv4nodejs: Installation error on CMake VS compiler

Created on 19 Jul 2019  路  6Comments  路  Source: justadudewhohacks/opencv4nodejs

Hi, I've been looking through the open and closed issues here, but I'm unable to find a duplicate. Please direct me to the solution/workaround if this has already been solved.

Here's the error I get every time I tried install:
ERR! Error: no cmake vs compiler found for msversion: 4

info install if you want to use an own OpenCV installation set OPENCV4NODEJS_DISABLE_AUTOBUILD
info readAutoBuildFile file does not exists: C:\Users\User\Documents\Projects\google-vision-text-detection\node_modules\opencv-build\opencv\auto-build.json C:\Users\User\Documents\Projects\google-vision-text-detection\node_modules\opencv-build\opencv\auto-build.json
info install failed to find auto-build.json: C:\Users\User\Documents\Projects\google-vision-text-detection\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.20.1.windows.1
info install
info install executing: cmake --version
info install cmake --version: cmake version 3.15.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): "Input string was not 
in a correct format."
info find-msbuild At line:1 char:124
info find-msbuild + ... ncv-build\Find-VS2017.cs'; [VisualStudioConfiguration.Main]::Query()}
info find-msbuild +                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
info find-msbuild     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
info find-msbuild     + FullyQualifiedErrorId : FormatException
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 find-msbuild version: 3.5, path: C:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe
info install using msbuild: { version: 4,
info install   path:
info install    'C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe' }
ERR! Error: no cmake vs compiler found for msversion: 4
npm WARN [email protected] No description

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.

OpenCV version: 3.4.6

With OpenCV-contrib? (extra modules): yes

OS: Windows 10

Most helpful comment

I believe I've found the solution (or at least how to resolve this particular error in my case). I noticed that we're both using Windows 10 and that as a part of the installation guide it mentions doing "npm install --global windows-build-tools" for Windows. It mentions in the instruction that this should install Visual Studio build tools 2015. However, this command is now installing the 2017 version by default. BUT if you add a "--vs2015" flag to the npm command, you'll get the appropriate version and the build should work out fine when you try to execute the opencv4nodejs package installation (assuming all the other pieces are setup as required).

So in a nutshell, do "npm install --global windows-build-tools --vs2015".

All 6 comments

Looks like you either have no up to date visual studio build tools installed or the one found by the script interferes with your installation. I remember a similar issue, try to remove all the .NET stuff from your sysem path

I'm also having the same issue. Will work on and report if I find a solution. If @seanquijote found a solution to this, I would greatly appreciate to know the solution.

I believe I've found the solution (or at least how to resolve this particular error in my case). I noticed that we're both using Windows 10 and that as a part of the installation guide it mentions doing "npm install --global windows-build-tools" for Windows. It mentions in the instruction that this should install Visual Studio build tools 2015. However, this command is now installing the 2017 version by default. BUT if you add a "--vs2015" flag to the npm command, you'll get the appropriate version and the build should work out fine when you try to execute the opencv4nodejs package installation (assuming all the other pieces are setup as required).

So in a nutshell, do "npm install --global windows-build-tools --vs2015".

Apologies for the late response. Thanks @snahrvar, your solution also works on my end.

I believe I've found the solution (or at least how to resolve this particular error in my case). I noticed that we're both using Windows 10 and that as a part of the installation guide it mentions doing "npm install --global windows-build-tools" for Windows. It mentions in the instruction that this should install Visual Studio build tools 2015. However, this command is now installing the 2017 version by default. BUT if you add a "--vs2015" flag to the npm command, you'll get the appropriate version and the build should work out fine when you try to execute the opencv4nodejs package installation (assuming all the other pieces are setup as required).

So in a nutshell, do "npm install --global windows-build-tools --vs2015".

Thanks for this!!!
I've been wandering for about few hours.

Hv u tried admin CMD?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

developer239 picture developer239  路  5Comments

G33kLabs picture G33kLabs  路  3Comments

goulash1971 picture goulash1971  路  7Comments

SatoshiKawabata picture SatoshiKawabata  路  5Comments

ryandons picture ryandons  路  4Comments