node 报错 npm error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe” 解决方法

node npm 报错 MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe” 解决方法

1、问题展示

npm install 或者 yarn install vue项目时报错:

gyp ERR! MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装 .NET Framework 2.0 SDK;2) 安装 M 
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (E:\Aisino\x7\frontend\front\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp ERR! System Windows_NT 10.0.22621
gyp ERR! command "D:\\MySoft\\Node\\node.exe" "E:\\Aisino\\x7\\frontend\\front\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd E:\Aisino\x7\frontend\front\node_modules\node-sass
gyp ERR! node -v v14.21.3

2、解决方法

缺少windows构建插件
管理员权限cmd窗口执行以下命令安装

npm install -g --production windows-build-tools

安装时间较长,耐心等待即可
安装完毕后,需要另起命令窗口执行 npm install,才能加载到刚下载的插件

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值