request to https://registry.yarnpkg.com/XXX, reason: getaddrinfo EAI_AGAIN regis

场景

项目是在win上搭建的,迁移到ubuntu ,使用yarn 安装时报错,需要一个包esbuild-linux-64,很明显,这是Esbuild 在linux 环境下的包,然而这个 ubuntu 操作系统不能接入外网。因此需要手动安装。

问题

root@xzbd-PC:/data/workspace/demo# yarn 
yarn install v1.22.18
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning "@ant-design/compatible > rc-form@2.4.12" has unmet peer dependency "prop-types@^15.0".
warning "@ant-design/pro-table > react-sortable-hoc@2.0.0" has unmet peer dependency "prop-types@^15.5.7".
warning " > @ant-design/pro-table@2.61.9" has unmet peer dependency "rc-field-form@^1.x".
warning " > @babel/plugin-syntax-typescript@7.16.5" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "dva > connected-react-router@6.5.2" has unmet peer dependency "react-router@^4.3.1 || ^5.0.0".
warning " > file-loader@6.2.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning " > react-router-breadcrumbs-hoc@2.3.2" has unmet peer dependency "react-router@^4.0.0".
warning " > react-router-breadcrumbs-hoc@2.3.2" has unmet peer dependency "react-router-dom@^4.0.0".
warning " > react-sortable-hoc@1.11.0" has unmet peer dependency "prop-types@^15.5.7".
warning " > url-loader@3.0.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning "@umijs/preset-react > @umijs/plugin-layout@0.18.1" has incorrect peer dependency "@ant-design/pro-layout@^6.0.0".
warning "@umijs/preset-react > @umijs/plugin-dva > babel-plugin-dva-hmr@0.4.2" has unmet peer dependency "redbox-react@1.x".
warning "@umijs/preset-react > @umijs/plugin-dva > dva-loading@3.0.22" has unmet peer dependency "dva-core@^1.1.0 | ^1.5.0-0 | ^1.6.0-0".
warning " > eslint-config-umi@1.6.0" has incorrect peer dependency "eslint-plugin-jsx-a11y@6.x".
warning " > eslint-config-umi@1.6.0" has incorrect peer dependency "eslint-plugin-react-hooks@1.5.0".
warning "eslint-config-umi > eslint-config-react-app@5.0.2" has unmet peer dependency "@typescript-eslint/eslint-plugin@2.x".
warning "eslint-config-umi > eslint-config-react-app@5.0.2" has unmet peer dependency "@typescript-eslint/parser@2.x".
warning "eslint-config-umi > eslint-config-react-app@5.0.2" has incorrect peer dependency "babel-eslint@10.x".
warning "eslint-config-umi > eslint-config-react-app@5.0.2" has incorrect peer dependency "eslint-plugin-flowtype@3.x".
warning "eslint-config-umi > eslint-config-react-app@5.0.2" has incorrect peer dependency "eslint-plugin-jsx-a11y@6.x".
warning "eslint-config-umi > eslint-config-react-app@5.0.2" has incorrect peer dependency "eslint-plugin-react-hooks@1.x".
warning " > eslint-plugin-jsx-a11y@5.1.1" has incorrect peer dependency "eslint@^2.10.2 || ^3 || ^4".
warning " > raw-loader@3.1.0" has unmet peer dependency "webpack@^4.3.0".
[5/5] Building fresh packages...
[-/12] ⠐ waiting...
[-/12] ⠐ waiting...
[-/12] ⠈ waiting...
[4/12] ⠈ esbuild
error /data/workspace/demo/node_modules/esbuild: Command failed.
Exit code: 1
Command: node install.js
Arguments: 
Directory: /data/workspace/demo/node_modules/esbuild
Output:
Trying to install "esbuild-linux-64" using npm
Failed to install "esbuild-linux-64" using npm: Command failed: npm install --loglevel=error --prefer-offline --no-audit --progress=false esbuild-linux-64@0.12.15
npm ERR! code EAI_AGAIN
npm ERR! syscall getaddrinfo
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.yarnpkg.com/esbuild-linux-64 failed, reason: getaddrinfo EAI_AGAIN registry.yarnpkg.com

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-04-29T06_38_34_408Z-debug-0.log

Trying to download "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.12.15.tgz"

解决

1. 下载包

根据提示,下载地址为 https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.12.15.tgz。在外网可以直接下载。

2. 安装

将下载好的安装包传送到 Ubuntu 操作系统。
在demo项目根目录下打开终端,执行

npm install esbuild-linux-64-0.12.15.tgz

请一定执行 install 操作 ,直接加在 node_modules 下是不行的。

安装完成后,运行 yarn , yarn start 则会成功。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值