Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@MaxBlack-dev
Copy link
Contributor

Description

This PR adds documentation clarifying how prerelease versions work with semver ranges in npm install commands.

Changes

  • Added a 'Prerelease versions' section under version range documentation
  • Explained that prereleases must be explicitly specified in ranges
  • Clarified that prerelease versions are tied to specific version triples
  • Provided examples showing how to match prereleases for patch vs major versions

Fixes

Closes #7851

Context

Users were confused about why version ranges like ^1.2.3-beta.1\ don't match \1.3.0-beta.1\ and why
pm outdated\ doesn't suggest updating from one prerelease to another with a higher patch version. This is by design in semver - prereleases are scoped to a specific major.minor.patch triple. The documentation previously didn't explain this behavior, leading to confusion about whether it was a bug.

The added documentation clarifies:

  1. Prerelease versions must be explicitly included in ranges (they're not matched by default)
  2. A range like ^1.2.3-beta.1\ only matches prereleases for \1.2.x\ versions
  3. To match all prereleases for a major version, use ^1.0.0-0\

Type of Change

  • Documentation update

@MaxBlack-dev MaxBlack-dev requested a review from a team as a code owner November 30, 2025 01:31
@owlstronaut owlstronaut merged commit 58afdcc into npm:latest Dec 1, 2025
8 checks passed
@github-actions github-actions bot mentioned this pull request Dec 1, 2025
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

Successfully merging this pull request may close these issues.

[BUG] npm install does not include pre-release when determining version to install

2 participants