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

Satisfy version miscomputed #17090

Closed
alessandro308 opened this issue Apr 28, 2023 · 1 comment
Closed

Satisfy version miscomputed #17090

alessandro308 opened this issue Apr 28, 2023 · 1 comment

Comments

@alessandro308
Copy link

alessandro308 commented Apr 28, 2023

Bug report

Running the function satisfy from https://github.com/webpack/webpack/blob/main/lib/util/semver.js results in a possible bug. Specifically:

satisfy(['^3.0.0'], '3.0.0-dev.5') === false
satisfy(['3.0.0-dev.5'], '3.0.0-dev.5') === false
satisfy(['^3.0.0'], '3.0.0') === true

but I expect 3.0.0-dev.5 to be greater than 3.0.0 so I expect the function to return true. Am I wrong?

@alexander-akait
Copy link
Member

alexander-akait commented Apr 28, 2023

It is by design, because 3.0.0-dev. is not greater than 3.0.0, for example, before release you can use -alpha/-beta (and any other prerelease tags), and they are less then 3.0.0, you can find more infromation here https://github.com/npm/node-semver#prerelease-tags

^1.2.3-beta.2 := >=1.2.3-beta.2 <2.0.0-0 Note that prereleases in the 1.2.3 version will be allowed, if they are greater than or equal to beta.2. So, 1.2.3-beta.4 would be allowed, but 1.2.4-beta.2 would not, because it is a prerelease of a different [major, minor, patch] tuple.

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

No branches or pull requests

2 participants