Alpha versioning causes strange resolutions when using ^
versioning in package.json
#2610
Open
2 of 4 tasks
^
versioning in package.json
#2610
Issue workflow progress
Progress of the issue based on the
Contributor Workflow
1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox
2. A failing test has been provided
3. A local solution has been provided
4. A pull request is pending review
Describe the bug
I lost quite a bit of time testing out
eslint
flat configs today because of the wayalpha
versions are defined. When using a "caret version", e.g.,"@graphql-eslint/eslint-plugin": "^4.0.0-alpha.5"
, package managers resolve this to a much older version than expected.See steps below for the exact version / examples.
To Reproduce Steps to reproduce the behavior:
You'll see that this actually resolved to an alpha version released in 2023:
You can also see this odd behavior on the NPM semver calculator page:
We can work around this issue by specifying the exact version in
package.json
(e.g., use4.0.0-alpha.5
instead of^4.0.0-alpha.5
).Expected behavior
The caret version should provide the most recent version in the series. So conceptually,
^4.0.0-alpha.5
should resolve to4.0.0-alpha.5
,4.0.0-alpha.6
, etc. It's very unexpected that it resolved to a tag from over one year ago.Environment:
@graphql-eslint/eslint-plugin
: 4.0.0-alpha.5Additional context
This behavior is the same with
yarn@4
andnpm
.The text was updated successfully, but these errors were encountered: