yarn add react: error An unexpected error occurred:

huangapple go评论67阅读模式
英文:

yarn add react: error An unexpected error occurred:

问题

yarn add react
yarn add v1.22.19
info No lockfile found.
error An unexpected error occurred: "https://registry.npmjs.org/react: connect ENETUNREACH 2606:4700::6810:1523:443".

Yarn-error.log

Arguments:
  /home/oab/.nvm/versions/node/v18.13.0/bin/node /usr/local/bin/yarn add react

PATH:
  /home/oab/.nvm/versions/node/v18.13.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

Yarn version:
  1.22.19

Node version:
  18.13.0

Platform:
  linux x64

Trace:
  Error: connect ENETUNREACH 2606:4700::6810:1523:443
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1487:16)

npm manifest:
  {
    "name": "01-configuranAPI",
    "version": "1.0.0",
    "main": "index.js",
    "license": "MIT"
  }

yarn manifest:
  No manifest

Lockfile:
  No lockfile

I have already performed the following commands:

`yarn cache clean`

and nothing, someone has the solution.
英文:
yarn add react
yarn add v1.22.19
info No lockfile found.
[1/4] Resolving packages...
error An unexpected error occurred: "https://registry.npmjs.org/react: connect ENETUNREACH 2606:4700::6810:1523:443".

Yarn-error.log

Arguments: 
  /home/oab/.nvm/versions/node/v18.13.0/bin/node /usr/local/bin/yarn add react

PATH: 
  /home/oab/.nvm/versions/node/v18.13.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

Yarn version: 
  1.22.19

Node version: 
  18.13.0

Platform: 
  linux x64

Trace: 
  Error: connect ENETUNREACH 2606:4700::6810:1523:443
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1487:16)

npm manifest: 
  {
    "name": "01-configuranAPI",
    "version": "1.0.0",
    "main": "index.js",
    "license": "MIT"
  }

yarn manifest: 
  No manifest

Lockfile: 
  No lockfile

I have already performed the following commands:

yarn cache clean

and nothing someone has the solution`
and nothing someone has the solution

答案1

得分: 1

你也可以通过环境选项强制 Node 使用 IPv4

$> NODE_OPTIONS="--dns-result-order=ipv4first" yarn add react
英文:

You can also force node to use ipv4 using env option

$> NODE_OPTIONS="--dns-result-order=ipv4first" yarn add react

huangapple
  • 本文由 发表于 2023年2月19日 05:55:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/75496632.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定