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

相关推荐
问心无愧05134 小时前
ctf show web入门160 161
前端·笔记
李小白664 小时前
第四天-WEB服务器基本原理,IIS服务
运维·服务器·前端
humcomm5 小时前
AI编程时代新前端职位
前端·ai编程
好家伙VCC5 小时前
Web Components主题热切换方案揭秘
java·前端
甲维斯5 小时前
Kimi版超级玛丽效果“惊人”,配额不足5厘米!
前端·人工智能
hboot5 小时前
AI工程师第一课 - Python
前端·后端·python
凉菜凉凉5 小时前
AI时代,被抛弃的前端
前端·ai
console.log('npc')6 小时前
AI前端工程与生成式UI学习路线
前端·人工智能·ui
梦曦i6 小时前
uni-router v1.1.1发布:守卫超时保护+路由监听
前端·uni-app
阿正的梦工坊6 小时前
【Rust】12-借用检查器与非词法生命周期
开发语言·后端·rust