nodejs / nodejs/node

When I use github codeaction to rebuild my package, `Error: EISDIR: illegal operation on a directory, lstat 'D:'` occurs

オープン
#61,165 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

説明

Version

v22.21.1

Platform
windows
Subsystem

No response

What steps will reproduce the bug?

Use codeaction to trigger prebuild.yml of my project.
For node v18 and v20, it's all good.

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

Every time I ran prebuild for v22 and above.

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

Prebuild successfully.

What do you see instead?

The log:

=== DEBUG: Execution Attempt ===
Attempting to execute: node node_modules\tree-sitter-cli\cli.js generate
Working directory for execution: D:\a\tree-sitter-arkts\tree-sitter-arkts
--- Trying Method 1: npx tree-sitter generate ---
node:fs:2744
    const out = binding.lstat(base, false, undefined, true /* throwIfNoEntry */);
                        ^
Error: EISDIR: illegal operation on a directory, lstat 'D:'
    at Object.realpathSync (node:fs:2744:25)
    at toRealPath (node:internal/modules/helpers:61:13)
    at Function._findPath (node:internal/modules/cjs/loader:733:24)
    at Function._resolveFilename (node:internal/modules/cjs/loader:1369:27)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22)
    at Function._load (node:internal/modules/cjs/loader:1192:37)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
    at Module.require (node:internal/modules/cjs/loader:1463:12) {
  errno: -4068,
  code: 'EISDIR',
  syscall: 'lstat',
  path: 'D:'
}
Node.js v22.21.1
Node process exited with status 1

I search for many methods trying to fix this issue but none of them takes effect. Please give me some advice of how to fix this bug. Thank you so much!!

Additional information

No response

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

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

はじめの一歩

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

調査の方向性

Node.js v22 で Windows GitHub Actions の prebuild を再現し、v18 および v20 と比較します。node:fs realpathSync、internal/modules/helpers.js toRealPath、CommonJS loader の stack trace のエントリポイントから開始し、D: ドライブが lstat に渡される理由を特定します。v22 以降で prebuild が正常に完了すれば完了です。

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

評価

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

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

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