MSBUILD Tools error with npm install
I am trying to run
npm install
on an Angular app. The earliest error with any useful information is:
MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "4.0"Then there is a long and detailed list of errors from
npm gyp
, the first in which MSBUILD is mentioned is:
gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exeThen
gyp info spawn args 'build/binding.sln'and then
gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
failed with exit code: 1
I have tried running
as advised by a colleague and StackOverflow but that command just hangs. I understand it's a large package to download but it hung for 4 or 5 hours. Then I tried
but that exits with a "Generic MSI Error". What more can I do to solve or at least diagnose this error?9 Replies
Yes, I have just tried
npm config set msvs_version 2022 --global
and am waiting for npm install
to finish againUnknown User•3y ago
Message Not Public
Sign In & Join Server To View
I can't change the way these command are invoked, it's all done my npm-gyp, but thanks for the info on the MSBUILD path, I have seen a way to set that for gyp somewhere
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Oh, it's running in PowerrShell. I've found a promising solution though, to update to the latest version of gyp
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
After some struggling it is using the VS 2022 dev tool, but now it has a build error.
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
It's a big improvement. Now I must just find the source file cited as causing the build error. Thanks for all the help, I'm gonna close this ticket and open a more on topic one if I need help again