Repository navigation
CI tests fail under Node.js 24.15.0 LTS (EBADF) #813
Description
Current behavior
Running typecheck, lint or test, as used in .github/workflows/ci.yml, fails when run locally under Node.js 24.15.0 LTS with:
Error: EBADF: bad file descriptor, fstat
This issue can also be expected to appear soon appears under GitHub Actions and causes CI workflow failure if / when since the cached Node.js versions in GitHub Actions runner images are updated to include Node.js 24.15.0 LTS.
Expected behavior
It should be possible to test Corepack successfully under Node.js Active LTS, including under the latest release Node.js 24.15.0.
Versions
Corepack 0.34.7
Ubuntu 24.04.4 LTS
Node.js 24.15.0 (Active LTS)
Yarn 4.11.0
Steps to reproduce
Install Node.js 24.15.0 LTS, then execute:
git clone https://github.com/nodejs/corepack
cd corepack
npm uninstall yarn -g # if previously installed
npm install corepack -g
corepack yarn install
corepack yarn build
corepack yarn typecheck
corepack yarn lint
corepack yarn testLogs
$ corepack yarn install
corepack yarn build
corepack yarn test
➤ YN0000: · Yarn 4.11.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 250ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ better-sqlite3@npm:11.10.0 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.27.7 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 1m 1s
➤ YN0000: · Done with warnings in 1m 2s
dist/lib/corepack.cjs 954.6kb
⚡ Done in 66ms
All shims have been generated.
node:fs:391
const stats = binding.fstat(fd, false, undefined, true /* shouldNotThrow */);
^
Error: EBADF: bad file descriptor, fstat
at tryStatSync (node:fs:391:25)
at readFileSync (node:fs:447:17)
at getSourceSync (node:internal/modules/esm/load:37:14)
at createCJSModuleWrap (node:internal/modules/esm/translators:210:32)
at ModuleLoader.commonjsStrategy (node:internal/modules/esm/translators:349:10)
at #translate (node:internal/modules/esm/loader:451:20)
at afterLoad (node:internal/modules/esm/loader:507:29)
at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:512:12)
at #getOrCreateModuleJobAfterResolve (node:internal/modules/esm/loader:555:36)
at afterResolve (node:internal/modules/esm/loader:603:52) {
errno: -9,
code: 'EBADF',
syscall: 'fstat'
}
Node.js v24.15.0
Other
The corresponding Yarn Berry issues:
- [Bug?]: Another case of EBADF. Node 24.15.0 (LTS) yarnpkg/berry#7102
- [BUG] HAS_BROKEN_FSTAT_FOR_ZIP_FDS version gate should include Node 24.15+ yarnpkg/berry#7103
state that this issue is fixed in yarn@v4.14.1
The results of attempting to fix with an upgrade are as follows:
| command | Yarn 4.11.0 | Yarn 4.14.1 |
|---|---|---|
corepack yarn typecheck |
Error: EBADF | success |
corepack yarn lint |
Error: EBADF | TypeError |
corepack yarn test |
Error: EBADF | success |
TypeError issue carried over to #814 for issue separation purposes.
Activity
MikeMcC399 commentedon Apr 19, 2026
PR #652 from @geigerzaehler could be reopened and rebased to workaround the Yarn pnp issues in this repo that affect only CI tests and usage. The PR migrates Corepack from Yarn
pnpto Yarnnode-modules.Resolution of the general issue that Yarn pnp users are having could then be decoupled from Corepack needs.
PR #652 was originally rejected with the statement:
That has proved to be ineffective as an advance test of compatibility, since Yarn users outside of Corepack have already found and reported the issue, whereas here in the Corepack repo the issue has not yet caused a failure. It's only been reported here because I manually tested compatibility locally. The fact that CI has not yet failed is also due to CI not having been extended to test under Node.js 25. The highest test version is Node.js 24.
MikeMcC399 commentedon Apr 21, 2026
MikeMcC399 commentedon Apr 24, 2026
MikeMcC399 commentedon Apr 24, 2026
macos-latest / macos-15 is now deployed to use Node.js 24.15.0 and so there is now a hard error testing macOS with Node.js 24. Every Dependabot version update PR now fails.
#817 proposes a resolution.
fix: docker dev build (Yarn 4.14.1) + soft-delete leak in paginated l…
MikeMcC399 commentedon May 6, 2026
MikeMcC399 commentedon May 11, 2026
It's also a race for who is first concerning the
corepack yarn linterror on Node.js 24.15.0:MikeMcC399 commentedon May 14, 2026
I'm closing this now, as
EBADFis no longer occurring.