英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论