使用npm安装时报错

在运行npm install安装时一直出现一下问题

npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmmirror.com/bootstrap failed, reason: connect ETIMEDOUT 240e:9f:d005:0:3::3fb: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!     D:\tools\nodejs\node_cache\_logs\2022-11-03T09_28_53_978Z-debug-0.log

使用npm安装时报错

解决方法

  1. 关闭代理并清空
    npm config set proxy null

    使用npm安装时报错

  2. 清理缓存
    npm cache clean --force

    使用npm安装时报错

  3. 重新设置镜像源(以下提供两个国内源自选一个)
    #淘宝源
    npm config set registry https://registry.npm.taobao.org
    #华为源
    npm config set registry https://repo.huaweicloud.com/repository/npm/

    使用npm安装时报错

  4. 设置后再次清理缓存
    npm cache clean -f

    使用npm安装时报错

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

给TA打赏
共{{data.count}}人
人已打赏
未分类

文章功能,文件下载

2021-5-30 7:34:36

技术教程

源支付3合1工具到期解决方法

2023-12-13 22:48:10

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索