MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。

MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。

大家在npm run dev 的时候会遇到标题所示的错误,以下是解决方法:

首先:

npm install --global --production windows-build-tools
PS C:\Users\leo> npm install --global --production windows-build-tools
npm WARN deprecated windows-build-tools@5.2.2: Node.js now includes build tools for Windows. You probably no longer need this tool. See https://github.com/felixrieseberg/windows-build-tools for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

> windows-build-tools@5.2.2 postinstall E:\node\node_global\node_modules\windows-build-tools
> node ./dist/index.js

Downloading vs_BuildTools.exe
[>                                            ] 0.0% (0 B/s)
Downloaded vs_BuildTools.exe. Saved to C:\Users\leo\.windows-build-tools\vs_BuildTools.exe.

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 --------------------
Python 2.7.18 is already installed, not installing again.

安装:
C:\Users\leo.windows-build-tools\vs_BuildTools.exe文件

安装完成后再npm run dev还是不行。

会报错:
webpack-dev-server的–inline 参数已经不适用
那就是webpack-dev-server的版本太高了,

npm uninstall webpack-dev-server
npm install webpack-dev-server@2.9.1

就可以了,希望对你有帮助!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值