前言
在使用npm安裝項(xiàng)目依賴的時(shí)候報(bào)錯(cuò)MSBUILD : error MSB3428: 未能加載 Visual C++ 組件“VCBuild.exe”画畅。要解決此問題,1) 安裝 .NET Framework 2.
如下圖:
npm 錯(cuò)誤
解決
原因是缺少windows構(gòu)建插件宋距,所以我們只需要安裝一下就好了
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,否知會報(bào)權(quán)限不足的:
Starting installation...
Please restart this script from an administrative PowerShell!