赞
踩
今天遇到npm下载什么依赖都报错,导致醒目无法打开
报错:这是我去下载镜像报的错
C:\Users\Administrator>npm install --global vue-cli
npm ERR! code ERR_TLS_CERT_ALTNAME_INVALID
npm ERR! errno ERR_TLS_CERT_ALTNAME_INVALID
npm ERR! request to https://registry.cnpmjs.org/vue-cli failed, reason: Hostname/IP does not match certificate’s altnames: Host: registry.cnpmjs.org. is not in the cert’s altnames: DNS:r.cnpmjs.org
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2021-06-07T03_39_27_641Z-debug.log
原因:我把C:\Users\Administrator\AppData\Roaming路径下的npm和npm-cache删除了,导致npm中项目运行,以及下载依赖无法下载的原因
解决办法:
npm config set registry https://registry.npm.taobao.org
npm install -g vue-cli
11:43分的内容都是淘宝镜像添加后才有的,我一开始没有下载好,才导致一直报错
二、使用axios报错
原因:vue-cli版本的问题
解决:下载方法
//vue-cli2.0命令
$ npm install axios
//vue-cli3.0命令
$ npm add axios
三、“vue-style-loader”依赖的问题
报
ERROR Failed to compile with 1 errors 5:47:55 PM
This dependency was not found:
* !!vue-style-loader!css-loader?{
"sourceMap":true}!../../node_modules/vue-loader/lib/style-compiler/index?{
"vue":true,"id":"data-v-e97c7212","scoped":true,"hasInlineConfig":false}!sass-loader?{
"sourceMap":
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。