前言
在使用npm安装项目依赖的时候报错MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装 .NET Framework 2.
如下图:
解决
原因是缺少windows构建插件,所以我们只需要安装一下就好了
npm install --global --production windows-build-tools
成功提示:
Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!
Status from the installers:
---------- Visual Studio Build Tools ----------
Still waiting for installer log file...
------------------- Python --------------------
Successfully installed Python 2.7
最后将原有的依赖删除,重新安装依赖就好了
rm -rf node_modules\ && npm install
Tips
这里一定要使用超级管理员打开 PowerShell,否知会报权限不足的:
Starting installation...
Please restart this script from an administrative PowerShell!