Skip to content

[BUG] overrides in package.json do not allow file paths of any kind (including fake ones) #5843

@aibolit

Description

@aibolit

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

I am seeing the error

npm verb stack TypeError: Invalid comparator: ./_EXCLUDED_     

Expected Behavior

The override library uses the file path specified like in major version 8. When the path specified points to nothing the dependency is ignored.

The usage is explained in this stackoverflow which doesnt work anymore

Steps To Reproduce

add an overrides section which points to a path kind of like

"overrides": {
  "canvas": "./_EXCLUDED_"
}

Environment

  • npm: 9.1.1
  • Node.js: 18.12.1
  • OS Name: Windows
  • System Model Name: n/a
  • npm config:
; "cli" config from command line options

location = "project"

; node bin location = C:\Users\someuser\somepath\.gradle\nodejs\node-v18.12.1-win-x64\node.exe
; node version = v18.12.1
; npm local prefix = C:\Users\someuser\somepath
; npm version = 9.1.1
; cwd = C:\Users\someuser\somepath
; HOME = C:\Users\someuser
; Run `npm config ls -l` to show all defaults.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingRelease 9.xwork is associated with a specific npm 9 releaseconfig:overridesIssues dealing with the overrides featureregression:9.x

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions