Skip to content

[Bug?]: (cross-post) EBADF: bad file descriptor, fstat with latest NodeJS v25 releases #7065

@jnoordsij

Description

@jnoordsij

Self-service

  • I'd be willing to implement a fix

Describe the bug

(cross-post of nodejs/node#62012 which may be relevant and/or solvable here)

With the latest NodeJS v25 releases (>= 25.7.0), a variety of tooling (e.g. ESLint, Vite) runs into an immediate error when used with Yarn PnP:

Error: EBADF: bad file descriptor, fstat

This can also be observed on the latest test workflows for the master branch in this repository; see e.g. https://github.com/yarnpkg/berry/actions/runs/22605132315/job/65618028428.

From nodejs/node#62012 (comment):

Don't know if this has anything to do with their esm loader's load hook returning source: undefined when passed format: 'commonjs'. Looking at the debug output, createCJSModuleWrap was previously being called with translateContext.source fully populated, whereas it's now being called with translateContext.source: undefined.

This seems to suggest there may be a way to fix this here. Otherwise if this is a break in NodeJS behavior which should be addressed there, it might be worthwhile to post additional context on nodejs/node#62012.

To reproduce

  1. Install NodeJS v25.7.0 or higher
  2. Install Yarn through e.g. Corepack
  3. yarn init && yarn add -D eslint && yarn eslint

See also nodejs/node#62012 (comment).

Environment

System:
    OS: observed on Windows 11 10.0.26200 / Alpine 3.23 / MacOS (likely more)
    CPU: varying
  Binaries:
    Node: >= 25.7.0
    Yarn: 4.12.0

Additional context

Thanks a lot for spending any time looking into this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions