1. The range
Two corners changed in node-semver 7.8: an x followed by a number, as in 1.x.2, is now an error outside ^ and ~, and with includePrerelease ~1.2 starts at 1.2.0-0 while ^0.2.3 starts at 0.2.3. Everything else reads the same. The CLI reads the node-semver version bundled with your npm and picks for you.
2. Versions and a second range (both optional)
One per line, comma separated, or the JSON array from npm view <package> versions --json.
For example a peer dependency range against yours, or an old range against the one you plan to publish.
Report
Every version
| Version | Matches | Why |
|---|
From the command line
The same engine, no dependencies, no network: npm view react versions --json | node cli.mjs '^18.2.0' - shows what npm would pick and why the rest miss; node cli.mjs '~1.2.5' --compare '^1.2' compares two ranges; node cli.mjs --project . lints every range in package.json and checks that package-lock.json still satisfies each one. Source and README.
Questions
Why doesn't my semver range match a prerelease like 2.0.0-beta.1?
Because npm only lets a prerelease match when some comparator in the same || branch names a prerelease of the same major.minor.patch. ^1.2.0 never matches 1.9.0-rc.1, and >=2.0.0-beta.1 matches 2.0.0-beta.4 but not 2.1.0-beta.0. Name the prerelease you want in the range, or run npm with --include-prerelease. The tool says which of these applies to every version you paste.
What does ^ (caret) mean in package.json?
It allows changes that do not touch the leftmost non-zero number. ^1.2.3 means at least 1.2.3 and below 2.0.0; ^0.2.3 means at least 0.2.3 and below 0.3.0; ^0.0.3 means 0.0.3 only. The tool prints the comparators each caret becomes.
What is the difference between ~ (tilde) and ^ (caret)?
A tilde allows patch updates when you give a minor version: ~1.2.3 is at least 1.2.3 and below 1.3.0, while ^1.2.3 goes up to below 2.0.0. With only a major, ~1 and ^1 are the same. Paste both into the compare box to see a version one allows and the other does not.
Why does npm install a version my range does not seem to allow, or skip one it does?
Usually a prerelease, a partial version, or a bare * branch. A partial upper bound like <1.4 means below 1.4.0-0; a hyphen range needs spaces, so 1.2.3-2.0.0 is one prerelease version, not a range; and in a range with several || branches, a branch that is just * makes npm ignore the others. The tool flags each of these.
How do I check whether one semver range is covered by another?
Paste both. The tool checks every version that can change the answer, including each named prerelease, and says whether the first range fits inside the second, the other way round, whether they overlap, and gives a version that proves each no.
Is anything I paste uploaded?
No. The engine runs in this browser tab. There are no accounts, cookies or analytics vendors, and the command-line version makes no network calls.