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

相关推荐
IT_陈寒15 分钟前
Python性能优化:5个被低估但效果惊人的内置函数实战解析
前端·人工智能·后端
00后程序员张19 分钟前
Fiddler使用教程,全面掌握Fiddler抓包工具的配置方法、代理设置与调试技巧(HTTPHTTPS全解析)
前端·测试工具·ios·小程序·fiddler·uni-app·webview
前端架构师-老李31 分钟前
15、Electron专题:使用 electron-store 进行本地数据存储
前端·javascript·electron
小白学大数据32 分钟前
双管齐下:结合显式等待与Timeout处理复杂Ajax网页
前端·javascript·ajax
Rysxt_35 分钟前
Electron 教程:从背景到 Vue3 桌面应用开发
前端·javascript·electron
luckyPian44 分钟前
前端+AI:CSS3(二)
前端·css·css3
JiKun1 小时前
一键配置 Web 前端开发环境(PowerShell 自动化脚本)
前端·windows·程序员
合作小小程序员小小店1 小时前
web网页开发,在线%考试,教资,题库%系统demo,基于vue,html,css,python,flask,随机分配,多角色,前后端分离,mysql数据库
前端·vue.js·后端·前端框架·flask
慧一居士1 小时前
ES6(ECMAScript 2015)功能介绍,使用场景,对应功能点完整使用示例
前端