Skip to content

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

@rendmath

Description

@rendmath

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingplatform:windowsis Windows-specific

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions