What each requirement means
These rows are checked by the same code that powers the tool above.
| Requirement | Equivalent range | Matches | Does not match |
|---|---|---|---|
1.2.3 | >=1.2.3, <2.0.0 | 1.2.3, 1.9.0 | 2.0.0, 1.2.2 |
^1.2 | >=1.2.0, <2.0.0 | 1.2.0, 1.99.0 | 2.0.0 |
^0.2.3 | >=0.2.3, <0.3.0 | 0.2.3, 0.2.9 | 0.3.0 |
^0.0.3 | >=0.0.3, <0.0.4 | 0.0.3 | 0.0.4 |
~1.2.3 | >=1.2.3, <1.3.0 | 1.2.9 | 1.3.0 |
~1 | >=1.0.0, <2.0.0 | 1.5.0 | 2.0.0 |
1.2.* | >=1.2.0, <1.3.0 | 1.2.7 | 1.3.0 |
=1.2.3 | =1.2.3 (exactly) | 1.2.3 | 1.2.4 |
>=1.2, <1.5 | >=1.2.0, <1.5.0 | 1.4.9 | 1.5.0 |
A bare version is not a pin
In Cargo, serde = "1.0.130" means ^1.0.130: any 1.x release at or above 1.0.130. To pin
an exact version, write "=1.0.130". npm does the opposite: there, a bare version is exact.
Why 0.x versions behave differently
Cargo treats the first non-zero number as the "major" version. ^0.3 therefore stops before
0.4.0, and ^0.0.3 allows only 0.0.3. Before 1.0, a minor release is assumed
to contain breaking changes.
Pre-releases
A pre-release like 1.3.0-beta.1 only matches if one of the comparators names the same
1.3.0 with a pre-release tag. That's why ^1.2 and even >=1.0.0 never pick
1.3.0-beta.1, while >=1.3.0-beta.1 does.
Coming from other ecosystems
- Cargo has no hyphen ranges (
1.0 - 2.0) and no||. Use commas, which mean "and". ~>is Ruby and Terraform syntax. In Cargo, write~1.2.- A leading
v(v1.2.3) and leading zeros (01.2) are errors. - A wildcard must be the only requirement:
*, <2is rejected.
About this checker
The engine is a TypeScript port of the semver crate 1.0.28, which is what Cargo uses. It is tested against the crate's own output for 55 requirements × 39 versions, including its exact error messages. Everything runs in your browser.