nodejs / nodejs/node

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

Open
#61,165 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale windows
Dominant language
JavaScript
Stars
122k
Forks
37.3k
Avg merge
4d 2h
Merged PRs (30d)
283

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Windows GitHub Actions prebuild with Node.js v22, comparing it with v18 and v20. Start from the stack-trace entry points in node:fs realpathSync, internal/modules/helpers.js toRealPath, and the CommonJS loader, then determine why the D: drive is passed to lstat; done means the prebuild completes successfully on v22 and later.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, javascript, node.js
Domain
backend, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.