Closed fxmb closed 1 year ago
I've got the same exact issue
Hi, I'm with the same issue:
I have a good internet connection
I installed the latest yarn package, I am also getting this issue as describe above.
I also had the same issue even though network connection was strong enough.
Same issue
Socket connection error are network connection error and aren't caused by Yarn, but by your own network (or the registry network, which is operated by npm).
+1
I had this same problem for my laptop, after restarting it it worked again.
I think Yarn is using ipv6 while Chrome is using ipv4 that's why I was able to browse internet just fine but yarn was struggling to even connect. After restarting my phone (I use my phone's hotspot) ipv6 is now working fine. I noticed git was also working slow and ping was not even working when trying to use ipv6 while ivp4 was working fine.
If you are facing this issue again try disabling ipv6 that may force yarn to use ipv4 which should fix this issue.
something to note is that for me it wasn't working with npm install
either. But I spammed yarn install a few times and each time it looked like it was making more progress until it finally completed.
user@i9-MBP example % yarn install
yarn install v1.22.19
[1/4] đ Resolving packages...
[2/4] đ Fetching packages...
error An unexpected error occurred: "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz: Socket connection timeout".
info If you think this is a bug, please open a bug report with the information provided in "/Users/user/ExampleSoftwareProjects/react-native-ble-manager/example/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
user@i9-MBP example % yarn install
yarn install v1.22.19
[1/4] đ Resolving packages...
[2/4] đ Fetching packages...
error An unexpected error occurred: "https://registry.npmjs.org/react/-/react-18.2.0.tgz: Socket connection timeout".
info If you think this is a bug, please open a bug report with the information provided in "/Users/user/ExampleSoftwareProjects/react-native-ble-manager/example/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
^C
user@i9-MBP example % yarn install
yarn install v1.22.19
[1/4] đ Resolving packages...
[2/4] đ Fetching packages...
error An unexpected error occurred: "https://registry.npmjs.org/@react-native-community/cli-platform-android/-/cli-platform-android-10.1.3.tgz: Socket connection timeout".
info If you think this is a bug, please open a bug report with the information provided in "/Users/user/ExampleSoftwareProjects/react-native-ble-manager/example/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
user@i9-MBP example % npm install
user@i9-MBP example % ping npm.com
PING npm.com (104.75.170.176): 56 data bytes
64 bytes from 104.75.170.176: icmp_seq=0 ttl=53 time=122.877 ms
64 bytes from 104.75.170.176: icmp_seq=1 ttl=53 time=147.259 ms
64 bytes from 104.75.170.176: icmp_seq=2 ttl=53 time=127.912 ms
64 bytes from 104.75.170.176: icmp_seq=3 ttl=53 time=131.708 ms
^C
--- npm.com ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 122.877/132.439/147.259/9.112 ms
user@i9-MBP example % yarn install
yarn install v1.22.19
[1/4] đ Resolving packages...
[2/4] đ Fetching packages...
error An unexpected error occurred: "https://registry.npmjs.org/@react-native-community/cli-platform-android/-/cli-platform-android-10.1.3.tgz: Socket connection timeout".
info If you think this is a bug, please open a bug report with the information provided in "/Users/user/ExampleSoftwareProjects/react-native-ble-manager/example/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
user@i9-MBP example % yarn install
yarn install v1.22.19
[1/4] đ Resolving packages...
[2/4] đ Fetching packages...
[3/4] đ Linking dependencies...
[4/4] đ¨ Building fresh packages...
⨠Done in 6.27s.
user@i9-MBP example % yarn install
yarn install v1.22.19
[1/4] đ Resolving packages...
success Already up-to-date.
same issue, it went through for me when I changed alpine
version of base node image to just node-20.2.0
version.
Just remove yarn.lock file and run yarn install
Just remove yarn.lock file and run yarn install
Äą tried but Äąt doesnt worked for me
I think Yarn is using ipv6 while Chrome is using ipv4 that's why I was able to browse internet just fine but yarn was struggling to even connect. After restarting my phone (I use my phone's hotspot) ipv6 is now working fine. I noticed git was also working slow and ping was not even working when trying to use ipv6 while ivp4 was working fine.
If you are facing this issue again try disabling ipv6 that may force yarn to use ipv4 which should fix this issue.
After setting my Network Settings -> Ethernet Settings -> TCP/IP -> IPv6 to Link-Local Only in the System Settings, the socket timeouts stopped.
Looks like, there is an issue with my IPv6 settings, network, whatever. Something to deal with another day.
Whatever command I run from whatever network connection speed (its fast), I get this error:
An unexpected error occurred: "https://registry.yarnpkg.com/<package-xy>: Socket connection timeout".
Even increasing the timeout until forever does not work:
yarn add --dev @types/estree --network-timeout 1000000000
This fails like 1-2 seconds after I initate the command.
I tried to...
yarn clean cache
My internet connection is more than fine though, what could be going on? Thanks