Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
2 tasks done
Dfenniak opened this issue Feb 14, 2023 · 1 comment
Closed
2 tasks done
Assignees
Labels
Bug thing that needs fixing Priority 1 high priority issue regression:9.x Release 9.x work is associated with a specific npm 9 release

Comments

@Dfenniak
Copy link

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
@Dfenniak Dfenniak added Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release labels Feb 14, 2023
@Dfenniak Dfenniak changed the title [BUG] <title> [BUG] NPM 9 changes wildcard matching without a breaking change note Feb 14, 2023
@lukekarrys lukekarrys added Priority 1 high priority issue regression:9.x and removed Needs Triage needs review for next steps labels Feb 15, 2023
AlansCodeLog added a commit to AlansCodeLog/vectortracer that referenced this issue Jul 4, 2023
This was due to a bug with npm npm/cli#6164.

Locally I could not replicate because normally I use pnpm, and pnpm uses
npm-packlist to get the proper files to pack. Unfortunately
semantic-release doesn't support pnpm, so for now the files have been
specified manually. This commit can be reverted when this is fixed or
semantic release supports pnpm.
@wraithgar
Copy link
Member

This got fixed quite some time ago in npm/npm-packlist#147 and shipped with npm@9.2.0

This issue is technically a duplicate of #5918

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug thing that needs fixing Priority 1 high priority issue regression:9.x Release 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

No branches or pull requests

3 participants