我一直在尝试通过多种解决方案来解决这个问题。它尚未修复。 我面临的问题是我的 2 台设备台式机和笔记本电脑都有 Linux 操作系统。 我的互联网连接足够稳定,我可以毫无问题地浏览,但每当我在
npm
和 yarn
命令上安装或执行任何操作时,另一方面,我都会收到此给定错误 pnpm
一切正常。
我尝试重新启动网络设备,扩展--network-timeout,这里没有代理和VPN,
npm
和yarn
缓存清理,更新所有内容等等。
yarn shows
info There appears to be trouble with your network connection. Retrying...
error AggregateError
at internalConnectMultiple (node:net:1114:18)
at internalConnectMultiple (node:net:1177:5)
at Timeout.internalConnectMultipleTimeout (node:net:1687:3)
at listOnTimeout (node:internal/timers:575:11)
at process.processTimers (node:internal/timers:514:7)
npm shows
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/@types%2fcookie-session failed, reason:
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: /home/liport/.npm/_logs/2024-01-09T05_28_45_333Z-debug-0.log
我安装了node 20版本后出现问题,然后有人说我必须安装node 18才能解决问题。
如果即使您拥有 Node 20 版本也遇到同样的问题,您可以尝试安装 Node 18 版本。这应该解决。