Skip to content

[BUG] NPM 9 changes wildcard matching without a breaking change note #6164

Closed
@Dfenniak

Description

@Dfenniak

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

When publishing a package with a package.json including:

  "files": [
    "/build/*"
  ],

In NPM 8 all subdirectories and their files would be included. In NPM 9 it seems this has changed to not include subdirectories.

Expected Behavior

I think this new behaviour is actually correct, I would expect "/build/**" or "/build/**/*" to be used for including subdirectories - but from reading through breaking changes I couldn't find any references for this change - it might be nice to have some kind of deprecation or changed behaviour mentioned if using a single asterisk notation.

Steps To Reproduce

  1. Set up a package to publish from a build folder with subdirectories and include the following in package.json
  "files": [
    "/build/*"
  ],
  1. Run 'npm package --dry-run'
  2. Note that with NPM 9 subdirectories aren't included and with NPM 8 they are.

Environment

  • npm:9.4.2
  • Node.js:v16.13.2
  • OS Name: n/a
  • System Model Name: n/a
  • npm config: n/a

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 1high priority issueRelease 9.xwork is associated with a specific npm 9 releaseregression:9.x

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions