Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Dependency minimatch@10 does not support Node 18, so it is wrong for this package to claim to #414

Closed
1 task
DavidAnson opened this issue Mar 3, 2025 · 10 comments
Labels

Comments

@DavidAnson
Copy link

Environment

Node version: 18
npm version: N/A
ESLint version: N/A
eslint-plugin-n version: Multiple
Operating System: N/A

Engines:

"node": "^18.18.0 || ^20.9.0 || >=21.1.0"

Dependency:

"minimatch": "^9.0.5",

Dependency engines:
https://github.com/isaacs/minimatch/blob/346685ced5203464bb10fd3d4dfa6964f6102ede/package.json#L53

What rule do you want to report?

N/A

Link to Minimal Reproducible Example

N/A

What did you expect to happen?

npm install for a package using this one should succeed when engine-strict=true instead of failing: https://github.com/DavidAnson/markdownlint/actions/runs/13622041054/job/38073048229#step:4:1

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

N/A

@DavidAnson DavidAnson added the bug label Mar 3, 2025
@DavidAnson
Copy link
Author

Actually, caret versioning above for v9 should not use v10, so maybe this is a transitive dependency? The problem reveals itself in a Dependabot update of this package from 17.5.1 to 17.6.1: DavidAnson/markdownlint#1526

@DavidAnson DavidAnson changed the title Direct dependency minimatch@10 does not support Node 18, so it is wrong for this package to claim to Dependency minimatch@10 does not support Node 18, so it is wrong for this package to claim to Mar 3, 2025
@DavidAnson
Copy link
Author

I can provide more info later if needed, but not from my phone.

@scagood
Copy link

scagood commented Mar 3, 2025

Image

It looks to be transitive from ts-declaration-location@1.0.5

PR cause: #392


Image

I wonder if CI run passed because we used the --force flag

@ghiscoding
Copy link

ghiscoding commented Mar 3, 2025

I got the same engine error when using Yarn 1.x (legacy),
Image
Image

I could also confirm the same as above that ts-declaration-location seems the dependency, and only one dep, causing the minimatch@10 breaking change.

Image

With Yarn it simply won't let me install it and will throw the error shown, I could use yarn install --ignore-engines to install it, which I did to run the yarn why minimatch command which is showing the result above.

@DavidAnson
Copy link
Author

@scagood If you are worried about also seeing markdownlint-cli in your output above (I was! :) ), that engines problem was fixed in release 0.44.0 by downgrading the two relevant dependencies: igorshubovych/markdownlint-cli@fc06ac9

@scagood
Copy link

scagood commented Mar 4, 2025

@RebeccaStevens Would it be possible to resolve the minimatch version in RebeccaStevens/ts-declaration-location?

@RebeccaStevens
Copy link

RebeccaStevens commented Mar 5, 2025

@scagood It looks like v10 of minimatch is the same as v9 minus the support for node 18. I should be able to just switch to using v9.

As an alternative, in this package you could add an override. This will prevent this issue arising again if another package upgrade minimatch to v10 or newer:

// package.json
{
    // ...
    "overrides": {
        "minimatch": "^9.0.5"
    },
}

Note: I haven't confirmed whether or not consuming packages will respect this override or not.

@scagood
Copy link

scagood commented Mar 6, 2025

I don't think overrides cascade to which ever package imports eslint-plugin-n 🤔

@ghiscoding
Copy link

I don't think overrides cascade to which ever package imports eslint-plugin-n 🤔

it worked for me with yarn resolutions, though I really think ts-declaration-location should downgrade its minimatch version to v9 since v10 was a breaking version and it should be reflected accordingly (it wasn't tagged as a breaking version when bumped in ts-declaration-location but I think it should have been, there's still time to correct it though)

"resolutions": {
  "minimatch": "^9.0.5"
}

@RebeccaStevens
Copy link

ts-declaration-location 1.0.6 now uses minimatch: ^9.0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants