npm / npm/cli

[BUG] `npm query` failing on Windows with case insensitive paths

Open
#8,510 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug platform:windows
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Is there an existing issue for this?
  • I have searched the existing issues
This issue exists in the latest npm version
  • I am using the latest npm
Current Behavior
npm query .workspace -C "C:\project\path"
npm query .workspace -C "c:\project\path" # Notice the lowercase "c"

The first one works but the second one fails with this unhelpful error.

npm error Cannot destructure property 'location' of 'node.target' as it is null.
Expected Behavior

All npm utilities behave in a case-insentitive way on Windows. Here both examples should work.

Steps To Reproduce

No response

Environment
  • npm: 11.5.2
  • Node.js: 22.18.0
  • OS Name: Windows

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 two npm query .workspace -C commands on Windows using the differently cased drive paths shown. Trace the query path handling to find where case normalization is missed, then verify that both commands succeed without the destructuring error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.