Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
child_process.execFileSync fails with EISDIR: illegal operation on a directory, lstat 'C:' on Windows in Node.js 22.20.0 | GoodFirstPicks

child_process.execFileSync fails with EISDIR: illegal operation on a directory, lstat 'C:' on Windows in Node.js 22.20.0

nodejs/node 1 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNode.jsJavaScript

Why this is a good first issue

Windows path handling regression in Node.js 22.20.0 affecting execFileSync.

AI Summary

The issue describes a regression in Node.js 22.20.0 where child_process.execFileSync fails with EISDIR errors on Windows when handling long paths with \?\ prefix. The fix likely involves Windows-specific path resolution logic, but requires understanding of Node's module system and Windows path handling. The exact scope isn't fully clear without deeper investigation of the module resolution changes between versions.

Issue Description

Version

v22.20.0

Platform

Microsoft Windows NT 10.0.26200.0 x64

Subsystem

No response

What steps will reproduce the bug?

Node.js 22.20.0 may have introduced a regression in module resolution where child_process.execFileSync() fails when executing binaries from certain Windows paths. The error occurs during internal module resolution and affects multiple path patterns.

Error: EISDIR: illegal operation on a directory, lstat 'C:'
    at Object.realpathSync (node:fs:2744:25)
    at toRealPath (node:internal/modules/helpers:61:13)
    at Module._findPath (node:internal/modules/cjs/loader:746:22)
    at resolveMainPath (node:internal/modules/run_main:39:23)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:163:20)
    at node:internal/main/run_main_module:36:49

Affected Path Patterns:

  • Very long paths (>260 characters) with \?\ prefix

How often does it reproduce? Is there a required condition?

Reproducible every time with long paths with \?\ prefix on Windows

What is the expected behavior? Why is that the expected behavior?

In node 20.19.0 tests with long paths with \?\ prefix were passing successfully

What do you see instead?

Error: EISDIR: illegal operation on a directory, lstat 'C:'
    at Object.realpathSync (node:fs:2744:25)
    at toRealPath (node:internal/modules/helpers:61:13)
    at Module._findPath (node:internal/modules/cjs/loader:746:22)
    at resolveMainPath (node:internal/modules/run_main:39:23)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:163:20)
    at node:internal/main/run_main_module:36:49 {
  errno: -4068,
  code: 'EISDIR',
  syscall: 'lstat',
  path: 'C:'
}

Additional information

No response

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • Windows-specific
  • path handling
  • potential regression
Loading labels...

Details

Points10 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno