Skip to content

CI tests fail under Node.js 24.15.0 LTS (EBADF) #813

@MikeMcC399

Description

@MikeMcC399

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 under GitHub Actions and cause CI workflow failure if / when 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 test

Logs

$ 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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions