在VUE安装依赖包时候,npm install任何都会出现对于安装包的400 Bad Request,更换镜像源也不起任何作用。
在网上找了很久,最后终于找到了解决方案:
控制台执行:
npm config get proxy
npm config get https-proxy
查看返回是否为null:
我这里就有一个不是,所以导致了问题的出现。
直接执行这两个命令,把他们都改为空:
npm config set proxy null
npm config set https-proxy null
再清理一下缓存:
npm cache clean --force
设置下载镜像为国内镜像:
npm config set registry https://registry.npmmirror.com
最后执行npm install即可成功安装所有依赖包。