npm ERR! code ETIMEDOUT

在新建vue项目的时候报错

复制代码
npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/@vue%2fcli failed, reason: connect ETIMEDOUT 104.16.2.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'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Yxx\AppData\Local\npm-cache\_logs\2024-03-01T01_48_15_071Z-debug-0.log

说是网络问题但是我也改了淘宝镜像

复制代码
npm config set registry https://registry.npm.taobao.org

但是还是报错,后来发现这个淘宝镜像已经在2022.06.30停用了,新的网址是

http://registry.npmmirror.com

复制代码
npm config set registry http://registry.npmmirror.com

需要解除镜像并恢复到官方源:

复制代码
npm config set registry https://registry.npmjs.org

查看npm源地址有没有换成功:

复制代码
npm config get registry

淘宝镜像网

相关推荐
e***98575 分钟前
node.js+npm的环境配置以及添加镜像(保姆级教程)
arcgis·npm·node.js
敲敲了个代码9 分钟前
一天面了6个前端开发,水平真的令人堪忧啊
前端·javascript·学习·面试·webpack·typescript·前端框架
恋猫de小郭9 分钟前
用 AI 做了几个超炫酷的 Flutter 动画,同时又差点被 AI 气死
前端·flutter·aigc
某空m10 分钟前
【Android】组件化搭建
android·java·前端
z***026012 分钟前
Node.js(v16.13.2版本)安装及环境配置教程
node.js
零基础的修炼12 分钟前
[项目]基于正倒排索引的Boost搜索引擎---服务和前端模块
前端
一勺菠萝丶16 分钟前
Vue组件状态同步问题:为什么修改了DOM值,提交时还是默认值?
前端·javascript·vue.js
程序员小寒18 分钟前
【无标题】
前端·css·面试·css3
蒙面价肥猫21 分钟前
Flex布局-彻底掌握 flex-grow / flex-shrink / flex-basis
前端·css·css3
DsirNg24 分钟前
上一个封装hooks涉及的知识学习路线
前端·javascript·typescript