Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yarn 3.5.1 | YN0001: │ RequestError: Socket connection timeout #5452

Closed
ZehuaZhang opened this issue May 17, 2023 · 11 comments
Closed

Yarn 3.5.1 | YN0001: │ RequestError: Socket connection timeout #5452

ZehuaZhang opened this issue May 17, 2023 · 11 comments

Comments

@ZehuaZhang
Copy link

ZehuaZhang commented May 17, 2023

yarn version 3.5.1

running yarn

➤ YN0000: ┌ Resolution step
➤ YN0001: │ RequestError: Socket connection timeout
    at ClientRequest.<anonymous> (/Users/===/.yarn/releases/yarn-3.5.1.cjs:195:14340)
    at Object.onceWrapper (node:events:626:26)
    at ClientRequest.emit (node:events:523:35)
    at o.emit (/Users/===/.yarn/releases/yarn-3.5.1.cjs:190:90286)
    at TLSSocket.socketErrorListener (node:_http_client:495:9)
    at TLSSocket.emit (node:events:511:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
    at new NodeError (node:internal/errors:399:5)
    at internalConnectMultiple (node:net:1099:20)
    at Timeout.internalConnectMultipleTimeout (node:net:1638:3)
    at listOnTimeout (node:internal/timers:575:11)
    at process.processTimers (node:internal/timers:514:7)

My inlined solution

@Baukaalm
Copy link

Baukaalm commented May 18, 2023

I have the same problem

@merceyz merceyz transferred this issue from yarnpkg/yarn May 18, 2023
@fsyntax
Copy link

fsyntax commented May 18, 2023

Same here, its very annoying I can't properly yarn install ..

@ZehuaZhang
Copy link
Author

So I fixed yesterday with the following, FYI, my existing project is running on intel mac, am migrating from yarn 1 to yarn 3

  1. remove brew installed node
  2. remove brew installed corepack
  3. remove yarn
  4. clean node cache npm cache clean
  5. download and install node from the mac installer in the official website
  6. npm i -g yarn
  7. go to your existing project, remove any yarn related files and folders, e.g. .yarn/, yarn.lock, .yarnrc.yml, and pnp files, which are plug and plays for yarn if any.
  8. add a new file in root, called .yarnrc.yml and add nodeLinker: node-modules, this is to tell yarn to install with traditional node_modules, the new recommended zero install, pnp, plug n play is buggy, some packages, like eslint, nextjs, are not installable and will occur the timeout error in current issue.
  9. in your project root, open a terminal, type yarn -v, it should show something like mine 3.5.1, which is beyond version 1, you don't need to set berry as mentioned in the original yarn doc
  10. run yarn install or yarn, it should install everything

So that is my fix, not sure what cause the error previously, hope it could be fixed. Don't get me wrong, yarn is still the best imo in terms of package install speed and resolving dependencies, pnpm is fast, but it has issues with nested dependencies, npm is just very slow and sluggish with nested / peer dependencies

@coucoseth
Copy link

@ZehuaZhang how did you remove yarn, i cant seem to find that in the documentation

@ZehuaZhang
Copy link
Author

@ZehuaZhang how did you remove yarn, i cant seem to find that in the documentation

Just reverse the order of how you installed yarn,

@tommyspot
Copy link

First thing, you should check your network.

@flyon
Copy link

flyon commented Aug 27, 2023

same issue here with yarn 3.5.1 and also the latest 3.6.1

@IgnisDa
Copy link

IgnisDa commented Sep 6, 2023

Don't know why but rm -rf ~/.yarn/berry/cache/ and npm clean --force normally fixes it for me.

@mattkindy
Copy link

Only had this problem on node 20 (v20.2.0). Switching to 18 resolved it.

@amartincolby
Copy link

This error is frustratingly intermittent. It is hard to know if a change fixed it or not or if things are randomly working for awhile. I have switched to Node 18 @mattkindy. So here's hoping.

legobeat added a commit to legobeat/metamask-extension that referenced this issue Feb 16, 2024
This reverts removal of support for node v18 in MetaMask#22755,
and suggests using node v18 instead of node v20 for local dev.

See: yarnpkg/berry#5452
legobeat added a commit to legobeat/metamask-extension that referenced this issue Feb 16, 2024
This reverts removal of support for node v18 in MetaMask#22755,
and suggests using node v18 instead of node v20 for local dev.

See: yarnpkg/berry#5452
@marcelo2605
Copy link

It's working with node 20.12.1 and yarn 3.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants