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 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

stale windows
主要语言
JavaScript
星标
122k
派生
37.4k
平均合并
4 天 3 小时
30 天内合并 PR
272

描述

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. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用 Node.js v22 重现 Windows GitHub Actions prebuild,并与 v18 和 v20 进行比较。从 node:fs realpathSync、internal/modules/helpers.js toRealPath 和 CommonJS loader 中的 stack trace 入口开始,然后确定为什么会将 D: 驱动器传递给 lstat;当 prebuild 在 v22 及更高版本上成功完成时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
github-actions, javascript, node.js
领域
backend, operating-systems
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。