首页 前端知识 【vue】npm install 时,报错:network request to https://registry.npmjs.org/xxx failed, reason: connect ETIM

【vue】npm install 时,报错:network request to https://registry.npmjs.org/xxx failed, reason: connect ETIM

2024-03-06 09:03:41 前端知识 前端哥 5 562 我要收藏

问题描述

npm install 时,报错:npm ERR! network request to https://registry.npmjs.org/postcss-pxtorem failed, reason: connect ETIMEDOU

npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/postcss-pxtorem failed, reason: connect ETIMEDOUT 104.16.1.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'

解决方案:修改镜像即可!

//1.查看npm镜像设置
npm config get registry

//2.将npm设置为淘宝镜像
npm config set registry https://registry.npm.taobao.org

//3.再次查看npm镜像设置
npm config get registry

参考链接:https://www.cnblogs.com/zdzdbk/p/16895319.html

转载请注明出处或者链接地址:https://www.qianduange.cn//article/3331.html
标签
npm
评论
发布的文章

JQuery简介与解析

2024-03-01 12:03:31

在Vue 3项目中使用 echarts

2024-03-29 15:03:05

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!