nodejs / nodejs/node

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

オープン
#60,435 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

stale windows
主要言語
JavaScript
スター
122k
フォーク
37.3k
平均マージ
4日 2時間
マージ済み PR(30日)
283

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、長い \?\ パスを使って Windows 22.20.0 上で child_process.execFileSync を再現し、その後、結果を Node 20.19.0 と比較します。報告されたパスを internal/modules/helpers、internal/modules/cjs/loader、internal/modules/run_main を通して追跡します。影響を受けるパスパターンが EISDIR lstat エラーなしに正常に実行されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, node.js
領域
backend, operating-systems
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。