NodeJS Yarn Socket连接超时

lvmkulzt  于 2023-06-05  发布在  Node.js
关注(0)|答案(1)|浏览(260)

当我尝试使用Yarn安装软件包时,我得到以下错误:

yarn add @mantine/prism    
yarn add v1.22.19
[1/4] Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@mantine%2fprism: Socket connection timeout".
info If you think this is a bug, please open a bug report with the information provided in "/home/rayorole/code/etherspay/etherspay-coming-soon/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

我也试过使用NPM,但是这个加载不确定,没有任何错误。我假设它与NPM相同的错误
我尝试重新启动我的系统,更新使用apt-get更新,改变网络,...不起作用,错误仍然存在。我有稳定的互联网连接
我在尝试更新系统时收到以下警告:

W: https://dl.yarnpkg.com/debian/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
t1rydlwq

t1rydlwq1#

看来我找到了解决办法。我在/etc/sysctl.conf中添加了以下行

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

之后,我使用

sudo sysctl -p

相关问题