npm install出现error MSB3428:Could not load the Visual C++ component VCBuild.exe错误

    我们在windows平台上运行npm install安装依赖的时候,会出现需要vcbuild环境,如下截图所示,根据提示解决办法是指定系统安装的vcbuild到环境变量的path中。

    npm install出现error MSB3428:Could not load the Visual C++ component VCBuild.exe错误

    解决办法就是通过npm全局安装windows-build-tools模块,还需要加上参数--production。

    npm install出现error MSB3428:Could not load the Visual C++ component VCBuild.exe错误 

    安装成功的打印信息:

    npm install出现error MSB3428:Could not load the Visual C++ component VCBuild.exe错误 

    安装过程会下载一个python2.7的环境,最后会在用户根目录生成一个.windows-build-tools目录。

    npm install出现error MSB3428:Could not load the Visual C++ component VCBuild.exe错误 

    .windows-build-tools目录中的内容如下 截图所示:

    npm install出现error MSB3428:Could not load the Visual C++ component VCBuild.exe错误 

    当我们再次进行npm install安装某些依赖的时候,就不会再报无法加载VCBuild.exe组件错误了。