node-gyp
node-gyp copied to clipboard
Getting ERR! Error: Command failed: node-gyp rebuild --jobs max. Error: Could not find any Visual Studio installation to use.
Complete log
C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs>if not defined npm_config_node_gyp (node "C:\Users\TestingAccount\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild --jobs max ) else (node "C:\Users\TestingAccount\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild --jobs max )
gyp ERR! find VS
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS - looking for Visual Studio version 2017
gyp ERR! find VS running in VS Command Prompt, installation path is:
gyp ERR! find VS "C:\Program Files"
gyp ERR! find VS - will only use this version
gyp ERR! find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp ERR! find VS checking VS2019 (16.11.31911.196) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v142
gyp ERR! find VS - found Windows SDK: 10.0.19041.0
gyp ERR! find VS - msvs_version does not match this version
gyp ERR! find VS checking VS2019 (16.11.31911.196) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v142
gyp ERR! find VS - found Windows SDK: 10.0.19041.0
gyp ERR! find VS - msvs_version does not match this version
gyp ERR! find VS checking VS2017 (15.9.28307.1745) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v141
gyp ERR! find VS - found Windows SDK: 10.0.17763.0
gyp ERR! find VS - does not match this Visual Studio Command Prompt
gyp ERR! find VS checking VS2017 (15.9.28307.1745) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v141
gyp ERR! find VS - found Windows SDK: 10.0.17763.0
gyp ERR! find VS - does not match this Visual Studio Command Prompt
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS msvs_version does not match this VS Command Prompt or the
gyp ERR! find VS installation cannot be used.
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (C:\Users\TestingAccount\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack at C:\Users\TestingAccount\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\TestingAccount\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack at C:\Users\TestingAccount\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack at C:\Users\TestingAccount\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack at C:\Users\TestingAccount\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack at C:\Users\TestingAccount\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:315:5)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Users\\TestingAccount\\nodejs\\node.exe" "C:\\Users\\TestingAccount\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--jobs" "max"
gyp ERR! cwd C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
ERR! Error: Command failed: node-gyp rebuild --jobs max
gyp ERR! find VS
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS - looking for Visual Studio version 2017
gyp ERR! find VS running in VS Command Prompt, installation path is:
gyp ERR! find VS "C:\Program Files"
gyp ERR! find VS - will only use this version
gyp ERR! find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp ERR! find VS checking VS2019 (16.11.31911.196) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v142
gyp ERR! find VS - found Windows SDK: 10.0.19041.0
gyp ERR! find VS - msvs_version does not match this version
gyp ERR! find VS checking VS2019 (16.11.31911.196) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v142
gyp ERR! find VS - found Windows SDK: 10.0.19041.0
gyp ERR! find VS - msvs_version does not match this version
gyp ERR! find VS checking VS2017 (15.9.28307.1745) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v141
gyp ERR! find VS - found Windows SDK: 10.0.17763.0
gyp ERR! find VS - does not match this Visual Studio Command Prompt
gyp ERR! find VS checking VS2017 (15.9.28307.1745) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v141
gyp ERR! find VS - found Windows SDK: 10.0.17763.0
gyp ERR! find VS - does not match this Visual Studio Command Prompt
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS msvs_version does not match this VS Command Prompt or the
gyp ERR! find VS installation cannot be used.
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (C:\Users\TestingAccount\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack at C:\Users\TestingAccount\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\TestingAccount\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack at C:\Users\TestingAccount\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack at C:\Users\TestingAccount\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack at C:\Users\TestingAccount\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack at C:\Users\TestingAccount\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:315:5)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Users\\TestingAccount\\nodejs\\node.exe" "C:\\Users\\TestingAccount\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--jobs" "max"
gyp ERR! cwd C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
OS : Windows 10 Error getting while installing opencv4nodejs Installed vs 2022,2019,2017 versions. Still having this error.
gyp ERR! node-gyp -v v5.1.0
Please upgrade to https://github.com/nodejs/node-gyp/releases using https://github.com/nodejs/node-gyp/blob/master/docs/Updating-npm-bundled-node-gyp.md
Thank you for the response. I have changed the node-gyp refernce and ran the installation command again. But still getting the same error.
C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild --jobs max ) else (node "C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild --jobs max ) gyp ERR! find VS gyp ERR! find VS msvs_version was set from command line or npm config gyp ERR! find VS - looking for Visual Studio version 2017 gyp ERR! find VS running in VS Command Prompt, installation path is: gyp ERR! find VS "C:\Program Files" gyp ERR! find VS - will only use this version gyp ERR! find VS checking VS2022 (17.0.31919.166) found at: gyp ERR! find VS "C:\Program Files\Microsoft Visual Studio\2022\Community" gyp ERR! find VS - found "Visual Studio C++ core features" gyp ERR! find VS - found VC++ toolset: v143 gyp ERR! find VS - found Windows SDK: 10.0.19041.0 gyp ERR! find VS - msvs_version does not match this version gyp ERR! find VS checking VS2019 (16.11.31911.196) found at: gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools" gyp ERR! find VS - found "Visual Studio C++ core features" gyp ERR! find VS - found VC++ toolset: v142 gyp ERR! find VS - found Windows SDK: 10.0.19041.0 gyp ERR! find VS - msvs_version does not match this version gyp ERR! find VS checking VS2019 (16.11.31911.196) found at: gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" gyp ERR! find VS - found "Visual Studio C++ core features" gyp ERR! find VS - found VC++ toolset: v142 gyp ERR! find VS - found Windows SDK: 10.0.19041.0 gyp ERR! find VS - msvs_version does not match this version gyp ERR! find VS checking VS2017 (15.9.28307.1745) found at: gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community" gyp ERR! find VS - found "Visual Studio C++ core features" gyp ERR! find VS - found VC++ toolset: v141 gyp ERR! find VS - found Windows SDK: 10.0.17763.0 gyp ERR! find VS - does not match this Visual Studio Command Prompt gyp ERR! find VS checking VS2017 (15.9.28307.1745) found at: gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools" gyp ERR! find VS - found "Visual Studio C++ core features" gyp ERR! find VS - found VC++ toolset: v141 gyp ERR! find VS - found Windows SDK: 10.0.17763.0 gyp ERR! find VS - does not match this Visual Studio Command Prompt gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use gyp ERR! find VS looking for Visual Studio 2015 gyp ERR! find VS - not found gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8 gyp ERR! find VS msvs_version does not match this VS Command Prompt or the gyp ERR! find VS installation cannot be used. gyp ERR! find VS gyp ERR! find VS ************************************************************** gyp ERR! find VS You need to install the latest version of Visual Studio gyp ERR! find VS including the "Desktop development with C++" workload. gyp ERR! find VS For more information consult the documentation at: gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows gyp ERR! find VS ************************************************************** gyp ERR! find VS gyp ERR! configure error gyp ERR! stack Error: Could not find any Visual Studio installation to use gyp ERR! stack at VisualStudioFinder.fail (C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47) gyp ERR! stack at C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16 gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:363:14) gyp ERR! stack at C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14 gyp ERR! stack at C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:384:16 gyp ERR! stack at C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\util.js:54:7 gyp ERR! stack at C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\util.js:33:16 gyp ERR! stack at ChildProcess.exithandler (child_process.js:315:5) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at maybeClose (internal/child_process.js:1048:16) gyp ERR! System Windows_NT 10.0.19042 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--jobs" "max" gyp ERR! cwd C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs gyp ERR! node -v v14.15.4 gyp ERR! node-gyp -v v8.4.1 gyp ERR! not ok ERR! Error: Command failed: node-gyp rebuild --jobs max gyp ERR! find VS gyp ERR! find VS msvs_version was set from command line or npm config gyp ERR! find VS - looking for Visual Studio version 2017 gyp ERR! find VS running in VS Command Prompt, installation path is: gyp ERR! find VS "C:\Program Files" gyp ERR! find VS - will only use this version gyp ERR! find VS checking VS2022 (17.0.31919.166) found at: gyp ERR! find VS "C:\Program Files\Microsoft Visual Studio\2022\Community" gyp ERR! find VS - found "Visual Studio C++ core features" gyp ERR! find VS - found VC++ toolset: v143 gyp ERR! find VS - found Windows SDK: 10.0.19041.0 gyp ERR! find VS - msvs_version does not match this version gyp ERR! find VS checking VS2019 (16.11.31911.196) found at: gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools" gyp ERR! find VS - found "Visual Studio C++ core features" gyp ERR! find VS - found VC++ toolset: v142 gyp ERR! find VS - found Windows SDK: 10.0.19041.0 gyp ERR! find VS - msvs_version does not match this version gyp ERR! find VS checking VS2019 (16.11.31911.196) found at: gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" gyp ERR! find VS - found "Visual Studio C++ core features" gyp ERR! find VS - found VC++ toolset: v142 gyp ERR! find VS - found Windows SDK: 10.0.19041.0 gyp ERR! find VS - msvs_version does not match this version gyp ERR! find VS checking VS2017 (15.9.28307.1745) found at: gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community" gyp ERR! find VS - found "Visual Studio C++ core features" gyp ERR! find VS - found VC++ toolset: v141 gyp ERR! find VS - found Windows SDK: 10.0.17763.0 gyp ERR! find VS - does not match this Visual Studio Command Prompt gyp ERR! find VS checking VS2017 (15.9.28307.1745) found at: gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools" gyp ERR! find VS - found "Visual Studio C++ core features" gyp ERR! find VS - found VC++ toolset: v141 gyp ERR! find VS - found Windows SDK: 10.0.17763.0 gyp ERR! find VS - does not match this Visual Studio Command Prompt gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use gyp ERR! find VS looking for Visual Studio 2015 gyp ERR! find VS - not found gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8 gyp ERR! find VS msvs_version does not match this VS Command Prompt or the gyp ERR! find VS installation cannot be used. gyp ERR! find VS gyp ERR! find VS ************************************************************** gyp ERR! find VS You need to install the latest version of Visual Studio gyp ERR! find VS including the "Desktop development with C++" workload. gyp ERR! find VS For more information consult the documentation at: gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows gyp ERR! find VS ************************************************************** gyp ERR! find VS gyp ERR! configure error gyp ERR! stack Error: Could not find any Visual Studio installation to use gyp ERR! stack at VisualStudioFinder.fail (C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47) gyp ERR! stack at C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16 gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:363:14) gyp ERR! stack at C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14 gyp ERR! stack at C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:384:16 gyp ERR! stack at C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\util.js:54:7 gyp ERR! stack at C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\util.js:33:16 gyp ERR! stack at ChildProcess.exithandler (child_process.js:315:5) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at maybeClose (internal/child_process.js:1048:16) gyp ERR! System Windows_NT 10.0.19042 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--jobs" "max" gyp ERR! cwd C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs gyp ERR! node -v v14.15.4 gyp ERR! node-gyp -v v8.4.1 gyp ERR! not ok
The version of node-gyp is now v8.4.1. But the VS is not getting detected. I have vs 2017 installed under : C:\Program Files (x86)\Microsoft Visual Studio\2017 C:\Program Files\Microsoft Visual Studio\2017 2019 installed under : C:\Program Files (x86)\Microsoft Visual Studio\2019 2022 installed under : C:\Program Files\Microsoft Visual Studio\2022\Community
The often-repeated line msvs_version does not match this version
seems to be the problem but I am not a Windows user.
The often-repeated line
msvs_version does not match this version
seems to be the problem but I am not a Windows user.
The version gets picked from the .npmrc file. Not sure it cant detect the Visual Studio.
Have these installations of VS in the system.
Are you aware of which Visual Studio installation file node-gyp looking for.
 {
this.configVersionYear = null
this.configPath = null
if (this.configMsvsVersion) {
this.addLog('msvs_version was set from command line or npm config')
if (this.configMsvsVersion.match(/^\d{4}$/)) {
this.configVersionYear = parseInt(this.configMsvsVersion, 10)
this.addLog(
`- looking for Visual Studio version ${this.configVersionYear}`)
} else {
this.configPath = path.resolve(this.configMsvsVersion)
this.addLog(
`- looking for Visual Studio installed in "${this.configPath}"`)
}
} else {
this.addLog('msvs_version not set from command line or npm config')
}
If we know the path "this.configPath" node-gyp looking for (In the file E:\Software\npm-gyp\node-gyp-8.4.1\lib\find-visualstudio) the we can try to set that manually and run to check whether it will work or not
Look thru your log output above for lines that start with gyp ERR! find VS checking VS20
to see all the versions that the code is finding on your computer. The problem is that after finding them, the code does not like their msvs_version
.
https://github.com/nodejs/node-gyp/blob/master/docs/Common-issues.md
I have installed VS from location mentioned in the above link and set the version as 2017 but for some reason still not picking the vs installation.
The "envVcInstallDir" gets the value "c://Program files" and the "vsPath " gets the actual installation path. Because of this the "return true" never gets executed. That is why the visual studio installation is not getting detected. On hard coding the path "MSBuild.exe" is getting detected.
But still fails with below error.
C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild --jobs max ) else (node "C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild --jobs max )
C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj(21,3): 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.
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\TestingAccount\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--jobs" "max"
gyp ERR! cwd C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok
ERR! Error: Command failed: node-gyp rebuild --jobs max
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\TestingAccount\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--jobs" "max"
gyp ERR! cwd C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok
Any one know how to sort this out
Anyone know whether this package require any additional tools to run in the AMD based system. Why I am asking because I just installed the opencv4nodejs (Which uses node-gyp) on my old intel based system just now. Not sure if it works. But the installation completed without error. So confuse if the issue is with my Ryzen processor. Both the systems have windows 10 installed and intel one(successful) have node v14.16.1 and amd one have 14.15.4. Not much difference.
Anyone know whether this package require any additional tools to run in the AMD based system. Why I am asking because I just installed the opencv4nodejs (Which uses node-gyp) on my old intel based system just now. Not sure if it works. But the installation completed without error. So confuse if the issue is with my Ryzen processor. Both the systems have windows 10 installed and intel one(successful) have node v14.16.1 and amd one have 14.15.4. Not much difference.
Hello, has your problem been solved, I also encountered this problem, and it has not been solved for several days
I'm getting the same error when installing @tensorflow/tfjs-node
One thing you can try out is installing previous versions of .net run time environment and try. If you have the latest system with windows 10/11 pre installed it may not have previous versions of .net which may be the cause. And for my case it was working in Intel based system so left that there.
But still fails with below error.
C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild --jobs max ) else (node "C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild --jobs max ) C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs\build\opencv4nodejs.vcxproj(21,3): 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. gyp ERR! build error gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) gyp ERR! System Windows_NT 10.0.19042 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\TestingAccount\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--jobs" "max" gyp ERR! cwd C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs gyp ERR! node -v v14.15.4 gyp ERR! node-gyp -v v8.4.1 gyp ERR! not ok ERR! Error: Command failed: node-gyp rebuild --jobs max gyp ERR! build error gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) gyp ERR! System Windows_NT 10.0.19042 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\TestingAccount\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--jobs" "max" gyp ERR! cwd C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\opencv4nodejs gyp ERR! node -v v14.15.4 gyp ERR! node-gyp -v v8.4.1 gyp ERR! not ok
guys am Having the same Issue on an Intel processor, amd64 have installed vs version but still can't wrap my head around why its not detecting visual studio, like i therer no human that has got a clue on how to solve this issue.
I had to re-install my OS just to make sure i do not have any conflicting programs. need help.
gyp ERR! node-gyp -v v8.4.1
https://github.com/nodejs/node-gyp/releases
Had a similar issue when installing danfojs-node
which is dependent on @tensorflow/tfjs-node
. These are the steps I took that helped me fix the problem,
- Ran
npm install --global --production windows-build-tools
which installed python 2.7 and VS build tools 2019, along with other things. - Went into
node_modules/@tensorflow/tfjs-node
directory and ran the command that was failing, in the case of this particular error log in this issue, it would be
"C:\Program Files\nodejs\node.exe" "C:\Users\TestingAccount\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--jobs" "max"
In my case, it mentioned that a particular SDK was missing The Windows SDK version 10.0.18362.0 was not found.
- I modified the installation of VS build tools 2019 to contain the missing SDK, using Visual studio installer, I think finding the SDK on the Microsoft archive will give an equivalent result. I also had to remove any other SDK so that
node-gyp
can find the particular SDK it was looking for.npm install
now works
This StackOverflow answer was a guide https://stackoverflow.com/a/50606326
Honestly, a lot of trial and error got me here. I hope this guides you to find your own solution.
Please use the updated Windows setup... https://github.com/nodejs/node-gyp?tab=readme-ov-file#on-windows