当在Windows环境中使用npm install或者yarn 安装依赖时,可能会出现如下类似的错误:

MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "4.0".

或者:

MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "12.0", "4.0".

该类错误发生在node-gyp在构建时未能找到所需版本的构建工具,解决方法如下:

npm install --global --production windows-build-tools
npm config set msvs_version 2015 --global

 

 

相关文章:

  • 2021-11-02
  • 2022-01-05
  • 2022-12-23
  • 2022-01-25
  • 2022-12-23
  • 2021-11-01
  • 2021-06-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-05
  • 2022-12-23
  • 2021-06-28
  • 2021-10-29
  • 2021-07-26
  • 2022-12-23
相关资源
相似解决方案