npm报错‘proxy‘ config is set properxy. See: ‘npm help config‘

1 报错信息

复制代码
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning ETIMEDOUT: request to https://registry.npmjs.org/vue-ref failed, reason: connect ETIMEDOUT 104.16.20.35:443 npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation. npm ERR! code ETIMEDOUT npm ERR! errno ETIMEDOUT npm ERR! network request to https://registry.npmjs.org/dom-closest failed, reason: connect ETIMEDOUT 104.16.22.35:443 npm ERR! network This is a problem related to network connectivity. npm ERR! network In most cases you are behind a proxy or have bad network settings. npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the npm ERR! network 'proxy' config is set properly. See: 'npm help config'

2 解决方案

step1 查代理
npm config get proxy
npm config get npm config get https-proxy
npm config get registry

step2 存在代理,缓存置空
npm config set proxy null
npm config set https-proxy null

step3 配置一个镜像源(选一个进行配置)

淘宝源:
npm config set registry http://registry.npm.taobao.org/

官方源:
npm config set registry http://registry.npmjs.org/

华为源
npm config set registry https://mirrors.huaweicloud.com/repository/npm/

其他命令:
npm cache clean
npm rebuild node-sass

相关推荐
GIS之路41 分钟前
GDAL 创建矢量图层的两种方式
前端
tang777891 小时前
爬虫如何绕过绕过“5秒盾”Cloudflare:从浏览器指纹模拟到Rust求解之不完全指南
开发语言·爬虫·rust·cloudflare
Yuer20251 小时前
什么是 Rust 语境下的“量化算子”——一个工程对象的最小定义
开发语言·后端·rust·edca os·可控ai
小目标一个亿1 小时前
Windows平台Nginx配置web账号密码验证
linux·前端·nginx
rocky1912 小时前
网页版时钟
前端·javascript·html
Aotman_2 小时前
Element-UI Message Box弹窗 使用$confirm方法自定义模版内容,修改默认样式
linux·运维·前端
计算机程序设计小李同学2 小时前
基于SSM框架的动画制作及分享网站设计
java·前端·后端·学习·ssm
一只小阿乐2 小时前
vue-web端实现图片懒加载的方
前端·javascript·vue.js
牛马1112 小时前
Flutter 多语言
前端·flutter
by————组态3 小时前
集成详细说明
前端·物联网·信息可视化·组态·组态软件