当在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