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

Revert "chore: update Node.js to v20 (#22755)" #22989

Closed
wants to merge 1 commit into from

Conversation

legobeat
Copy link
Contributor

@legobeat legobeat commented Feb 16, 2024

Description

This reverts removal of support for node v18 in #22755, and suggests using node v18 instead of node v20 for local dev. The other changes from that PR have not been reverted.

This resolves the following error when running yarn [install] locally:

➤ YN0000: │ MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
➤ YN0001: │ RequestError
    at ClientRequest.<anonymous> (metamask-extension/.yarn/releases/yarn-4.0.2.cjs:147:14258)
    at Object.onceWrapper (node:events:629:26)
    at ClientRequest.emit (node:events:526:35)
    at u.emit (metamask-extension/.yarn/releases/yarn-4.0.2.cjs:142:14420)
    at TLSSocket.socketErrorListener (node:_http_client:495:9)
    at TLSSocket.emit (node:events:514: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)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)

full log

Related issues

Manual testing steps

  1. Remove local node_modules directory and clear local yarn cache
  2. Run yarn

Screenshots/Recordings

Before

N/A

After

N/A

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

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 legobeat marked this pull request as ready for review February 16, 2024 07:27
@legobeat legobeat requested a review from a team as a code owner February 16, 2024 07:27
@legobeat
Copy link
Contributor Author

In my case, this was related to having a non-publicly-routable IPv6 address assigned.

Will supposedly be fixed in the next v20 release: nodejs/node#51045

In the meantime, the advice in this comment is a workaround.

For those waiting on a fix: the workaround is to add dns-result-order=ipv4first and/or no-network-family-autoselection to node's command line options or the NODE_OPTIONS environment variable.

NODE_OPTIONS="--no-network-family-autoselection ${NODE_OPTIONS}" yarn did the trick here.

@legobeat legobeat marked this pull request as draft February 16, 2024 14:22
@legobeat legobeat closed this Feb 16, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant