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

[Bug?]: nodeLinker: node-modules is broken in Node.js 22.5.0 #6398

Closed
1 task
latin-1 opened this issue Jul 17, 2024 · 4 comments
Closed
1 task

[Bug?]: nodeLinker: node-modules is broken in Node.js 22.5.0 #6398

latin-1 opened this issue Jul 17, 2024 · 4 comments
Labels
bug Something isn't working external bug This issue highlights a bug in another project

Comments

@latin-1
Copy link

latin-1 commented Jul 17, 2024

Self-service

  • I'd be willing to implement a fix

Describe the bug

On my local machine: freeze during the link step (clean install)
On CI: Couldn't find the node_modules state file - running an install might help (findPackageLocation)

To reproduce

Repo: https://github.com/latin-1/berry-node-22.5.0-broken

Node.js 22.4.1:
https://github.com/latin-1/berry-node-22.5.0-broken/actions/runs/9978668516/job/27576055285

Node.js 22.5.0:
https://github.com/latin-1/berry-node-22.5.0-broken/actions/runs/9978678303/job/27576083419

Environment

System:
    OS: Linux 6.9 Arch Linux
    CPU: (16) x64 AMD Ryzen 7 6800U with Radeon Graphics
  Binaries:
    Node: 22.5.0 - /tmp/xfs-8a836774/node
    Yarn: 4.3.1 - /tmp/xfs-8a836774/yarn
    npm: 10.8.2 - ~/.proto/shims/npm
    pnpm: 9.5.0 - ~/.proto/shims/pnpm
    bun: 1.1.20 - ~/.proto/shims/bun
  npmPackages:
    jest: 29.7.0 => 29.7.0

Additional context

No response

@latin-1 latin-1 added the bug Something isn't working label Jul 17, 2024
@merceyz
Copy link
Member

merceyz commented Jul 17, 2024

Bisects to nodejs/node#53627.
Seems to have been reported upstream in nodejs/node#53902.

@anonrig
Copy link

anonrig commented Jul 18, 2024

Can you open a new issue to Node.js repository, with a reproduction that is easily reproducible without Yarn?

@merceyz merceyz added the external bug This issue highlights a bug in another project label Jul 18, 2024
arcanis pushed a commit that referenced this issue Jul 18, 2024
**What's the problem this PR addresses?**

If the event loop unexpectedly becomes empty `yarn` will terminate with
exit code 0 even though the command didn't complete successfully.

Ref nodejs/node#53902

Ref #6398 where that happens and
the install is incomplete when `yarn` terminates with exit code 0. It's
caught in the following `yarn build` step which can't find the install
state.

**How did you fix it?**

Set `process.exitCode` to an error code before executing the CLI so an
unexpected empty event loop counts as an error.

**Checklist**
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
- [x] I have set the packages that need to be released for my changes to
be effective.
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.
nodejs-github-bot pushed a commit to nodejs/node that referenced this issue Jul 18, 2024
This reverts commit ed6f45b.

PR-URL: #53904
Refs: yarnpkg/berry#6398
Refs: npm/cli#7657
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
richardlau pushed a commit to nodejs/node that referenced this issue Jul 19, 2024
This reverts commit ed6f45b.

PR-URL: #53904
Refs: yarnpkg/berry#6398
Refs: npm/cli#7657
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
richardlau added a commit to nodejs/node that referenced this issue Jul 19, 2024
Notable changes:

This release fixes a regression introduced in Node.js 22.5.0. The
problem is known to display the following symptoms:

- Crash with
```
FATAL ERROR: v8::Object::GetCreationContextChecked No creation context available
```

- npm errors with `npm error Exit handler never called!`

- yarn hangs or outputs
```
Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)
```

PR-URL: #53935
Refs: #53902
Refs: npm/cli#7657
Refs: yarnpkg/berry#6398
Bullrich added a commit to paritytech/metrics that referenced this issue Jul 19, 2024
It seems that it is a problem related to node yarnpkg/berry#6398 so downgrading the library should fix it
Bullrich added a commit to paritytech/metrics that referenced this issue Jul 19, 2024
While yarnpkg/berry#6398 is a problem, it may be better to use npm
olibos added a commit to olibos/fleet-management that referenced this issue Jul 19, 2024
richardlau added a commit to nodejs/node that referenced this issue Jul 19, 2024
Notable changes:

This release fixes a regression introduced in Node.js 22.5.0. The
problem is known to display the following symptoms:

- Crash with
```
FATAL ERROR: v8::Object::GetCreationContextChecked No creation context available
```

- npm errors with `npm error Exit handler never called!`

- yarn hangs or outputs
```
Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)
```

PR-URL: #53935
Refs: #53902
Refs: npm/cli#7657
Refs: yarnpkg/berry#6398
@merceyz
Copy link
Member

merceyz commented Jul 19, 2024

Closing as Node.js v22.5.1 has been released with a fix for this issue.

@merceyz merceyz closed this as completed Jul 19, 2024
mcmire added a commit to MetaMask/eth-json-rpc-middleware that referenced this issue Jul 19, 2024
There seems to be a regression in Node 22.5.0 which [prevents `yarn
install` from running][1] and in turns prevents CI from completing
successfully. This regression was [fixed in 22.5.1][2], so this commit
ensures that CI is using this version.

[1]: yarnpkg/berry#6398
[2]: nodejs/node#53935
mcmire added a commit to MetaMask/eth-json-rpc-middleware that referenced this issue Jul 19, 2024
There seems to be a regression in Node 22.5.0 which [prevents `yarn
install` from running][1] and in turns prevents CI from completing
successfully. This regression was [fixed in 22.5.1][2]. We are using
`22.x` in CI, so in theory it should be using this version, but that
does not seem be the case right now. So this commit ensures that CI is
using this version by naming it explicitly.

[1]: yarnpkg/berry#6398
[2]: nodejs/node#53935
mcmire added a commit to MetaMask/eth-json-rpc-middleware that referenced this issue Jul 19, 2024
There seems to be a regression in Node 22.5.0 which [prevents `yarn
install` from running][1] and in turns prevents CI from completing
successfully. This regression was [fixed in 22.5.1][2]. We are using
`22.x` in CI, so in theory it should be using this version, but that
does not seem be the case right now. So this commit ensures that CI is
using this version by naming it explicitly.

[1]: yarnpkg/berry#6398
[2]: nodejs/node#53935
github-merge-queue bot pushed a commit to rustymotors/server that referenced this issue Jul 24, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [node](https://nodejs.org)
([source](https://togithub.com/nodejs/node)) | patch | `22.5.0` ->
`22.5.1` |

---

### Release Notes

<details>
<summary>nodejs/node (node)</summary>

### [`v22.5.1`](https://togithub.com/nodejs/node/releases/tag/v22.5.1):
2024-07-19, Version 22.5.1 (Current), @&#8203;richardlau

[Compare
Source](https://togithub.com/nodejs/node/compare/v22.5.0...v22.5.1)

##### Notable Changes

This release fixes a regression introduced in Node.js 22.5.0. The
problem is known to display the following symptoms:

- Crash with `FATAL ERROR: v8::Object::GetCreationContextChecked No
creation context available`
[#&#8203;53902](https://togithub.com/nodejs/node/issues/53902)
- npm errors with `npm error Exit handler never called!`
[npm/cli#7657](https://togithub.com/npm/cli/issues/7657)
- yarn hangs or outputs `Usage Error: Couldn't find the node_modules
state file - running an install might help (findPackageLocation)`
[yarnpkg/berry#6398](https://togithub.com/yarnpkg/berry/issues/6398)

##### Commits

- \[[`e2deeedc6e`](https://togithub.com/nodejs/node/commit/e2deeedc6e)]
- ***Revert*** "**fs**: add v8 fast api to closeSync" (Aviv Keller)
[#&#8203;53904](https://togithub.com/nodejs/node/pull/53904)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/rustymotors/server-old).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzEuNCIsInVwZGF0ZWRJblZlciI6IjM3LjQzOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
@JonasSchoenwald
Copy link

Just for those searching for the problem on google (etc.)
This node version also causes a hang on the Link step during a yarn install, at least on windows

Updating/Downgrading fixes this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external bug This issue highlights a bug in another project
Projects
None yet
Development

No branches or pull requests

4 participants