[BUG] `npm query` failing on Windows with case insensitive paths
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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