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

network request to https://registry.npmjs.org/xxx failed, reason: connect ETIM

目录:

    • 1、问题描述
    • 2、解决方案
    • 3、npm镜像仓库替换

1、问题描述

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'

2、解决方案

  • 修改镜像即可!
  • 推荐使用淘宝的镜像npm config set registry https://registry.npmmirror.com
//1.查看npm镜像设置
npm config get registry

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

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

3、npm镜像仓库替换

//替换镜像的操作
1、查看当前的npm镜像设置:npm config list
2、清空缓存:npm cache clean --force
3、替换镜像地址:npm config set registry https://registry.npmmirror.com

在这里插入图片描述

!!!注意:此处修改的镜像用的是npm本身,一般国内用户还是建议使用淘宝镜像,所以推荐还是设置成用淘宝镜像,执行:npm config set registry https://registry.npmmirror.com 【推荐】


http://www.kler.cn/news/317381.html

相关文章:

  • Cesium影像纠偏:高德地图加载与坐标系纠偏技巧
  • 【机器学习(九)】分类和回归任务-多层感知机 (MLP) -Sentosa_DSML社区版
  • Github 2024-09-21Rust开源项目日报 Top10
  • Qt/C++ 了解NTFS文件系统,解析0x80 $Data属性,获取Run Lists数据列表
  • 仓颉编程语言4,遇到BUG求助
  • 数据中心里全速运行的处理器正在浪费能源
  • golang格式化输入输出
  • 【3D打印】使用simplify 3D切片更改Gcode手动断电续打、掉电、未打完继续打印、补救
  • Parallels Desktop 20 for Mac 推出:完美兼容 macOS Sequoia 与 Win11 24H2
  • 【Godot4.3】自定义数列类NumList
  • 【Qt | Qstring】Qstring详细介绍(字符串的添加、删除、修改、查询、截断、删除空白字符等)
  • Gitlab runner的使用示例(二):Maven + Docker 自动化构建与部署
  • 【游戏引擎】C++自制游戏引擎 Lunar Game Engine
  • 基于vue框架的宠物销售管理系统3m9h3(程序+源码+数据库+调试部署+开发环境)系统界面在最后面。
  • 微软开源GraphRAG的使用教程-使用自定义数据测试GraphRAG
  • Java中的快速排序算法详解
  • c++ pair
  • ubuntu下检查端口是否占用问题,编写shell脚本检查端口是否占用
  • 使用Python实现图形学曲线和曲面的NURBS算法
  • ChartLlama: A Multimodal LLM for Chart Understanding and Generation论文阅读
  • unity Compute Shaders 使程序在GPU中运行
  • LeetCode54. 螺旋矩阵(2024秋季每日一题 21)
  • 计算机毕业设计Hadoop+PySpark深圳共享单车预测系统 PyHive 共享单车数据分析可视化大屏 共享单车爬虫 共享单车数据仓库 机器学习 深度学习
  • 工博会蓝卓逛展攻略
  • C#测试调用Ghostscript.NET浏览PDF文件
  • <刷题笔记> 二叉搜索树与双向链表注意事项
  • OpenHarmony(鸿蒙南向开发)——标准系统方案之瑞芯微RK3568移植案例(上)
  • 流域碳中和技术
  • 使用Docker一键部署Blossom笔记软件
  • 【C#生态园】一文详解:NHibernate、Entity Framework Core、Dapper 等 .NET ORM 框架优劣对比