当前位置: 首页 > news >正文

npm安装依赖包报错,npm ERR! code ENOTFOUND

一、报错现象:

npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning ETIMEDOUT: request to https://registry.npmjs.org/vue failed, reason: connect ETIMEDOUT 104.16.23.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/vue/-/vue-3.2.36.tgz failed, reason: connect ETIMEDOUT 104.16.26.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\Sophia.Li\AppData\Roaming\npm-cache\_logs\2023-02-21T05_08_58_618Z-debug.log

二、切换成淘宝镜像


npm config set registry https://registry.npm.taobao.org
重新安装npm i

request to httpsregistry.npm.taobao.org failed, reason certificate has expired的解决方案,

三、借鉴方案
3.1 查看当前的npm镜像设置:npm config list

3.2 清空缓存:npm cache clean --force
3.3 然后修改镜像即可:npm config set registry https://registry.npmjs.org/
3.4 再次运行: npm config list,查看 registry 已经被更改为默认的 npm 公共镜像地址。

四、可以正常使用npm啦~

http://www.lryc.cn/news/402409.html

相关文章:

  • 【iOS】——内存对齐
  • 网络安全-网络安全及其防护措施10
  • Pytorch基础应用
  • Axure 教程 | 设置文本框背景透明
  • 【BUG】已解决:NOAUTH Authentication required
  • 全国产服务器主板:搭载飞腾FT2000+/64处理器的高性能加固服务器
  • OPC UA边缘计算耦合器BL205工业通信的最佳解决方案
  • 【已解决】Django连接MySQL启动报错Did you install mysqlclient?
  • ubuntu gcc g++版本切换
  • 如何发一篇顶会论文? 涉及3D高斯,slam,自动驾驶,三维点云等等
  • Java面试八股之什么是Redis的缓存更新
  • 新华三H3CNE网络工程师认证—VLAN使用场景与原理
  • Linux-开机自动挂载(文件系统、交换空间)
  • [003-02-10].第10节:Docker环境下搭建Redis主从复制架构
  • uni-app学习HBuilderX学习-微信开发者工具配置
  • 持续集成08--Jenkins邮箱发送构建信息及测试报告
  • 专题四:设计模式总览
  • 基于X86+FPGA+AI数字化医疗设备:全自动尿沉渣检测仪
  • vue2导入elementui组件库
  • Django定时任务框架django-apscheduler的使用
  • 知识库文档处理,word转markdown
  • TF和TF-IDF区别和联系
  • 02线性表 - 链表
  • 高性能、安全、低碳绿色的趋势下,锐捷网络发布三擎云办公解决方案 3.0
  • python3 shutil排除特定或者模糊匹配文件或目录
  • Spire.PDF for .NET【文档操作】演示:如何在 C# 中切换 PDF 层的可见性
  • 新文件覆盖旧文件还能复原吗?八大excel文档修复软件免费
  • Android 10.0 Launcher3拖拽图标进入hotseat自适应布局功能实现一
  • 彻底解决idea的编解码问题
  • 仅两家!云原生向量数据库 PieCloudVector 全项通过信通院「可信数据库」评测