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

相关推荐
疯狂的小老鼠5 分钟前
vue的响应式原理
前端·javascript·vue.js
Lingxing31 分钟前
深入浅出:从JS的new运算符到手写ES5/ES6版实现
前端·javascript·ecmascript 6
用户91858244797334 分钟前
关于vue中的scoped
前端
木木黄木木39 分钟前
炫酷的3D按钮效果实现 - CSS3高级特性应用
前端·3d·css3
木木黄木木43 分钟前
html5基于Canvas的经典打砖块游戏开发实践
前端·html·html5
顾言71643 分钟前
uniapp 和 webview 之间的通信
前端
bin91531 小时前
DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)之添加导出数据功能示例7,TableView15_07带边框和斑马纹的导出表格示例
前端·javascript·vue.js·ecmascript·deepseek
大博士.J1 小时前
vscode终端不识别npm 无法解析npm
ide·vscode·npm
木木黄木木1 小时前
html5炫酷3D立体文字效果实现详解
前端·3d·html5
我认不到你1 小时前
油候插件、idea、VsCode插件推荐(自用)
java·前端·vscode·react.js·typescript·编辑器·intellij-idea