Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

fix(reify): properly save spec if prerelease #279

Merged
merged 1 commit into from
May 10, 2021

Conversation

wraithgar
Copy link
Member

@wraithgar wraithgar commented May 6, 2021

Currently if you add a package w/ spec * (or with no spec, which
defaults to *) arborist tries to do a semver.subset to see if it can
use the spec that actually got installed. This fails if the new spec has
a prerelease tag in it.

This change fixes it so that if the spec was * it just goes ahead and
uses the new spec no matter what, since no valid semver doesn't match
* in this case

The use case here is when a package tags latest w/ a version that has
a prerelease tag.

References

Fixes npm/cli#2934

Currently if you add a package w/ spec `*` (or with no spec, which
defaults to `*`) arborist tries to do a semver.subset to see if it can
use the spec that actually got installed. This fails if the new spec has
a prerelease tag in it.

This change fixes it so that if the spec was `*` it just goes ahead and
uses the new spec no matter what, since no valid semver doesn't match
`*` in this case
@wraithgar wraithgar force-pushed the gar/install-prerelease-save branch from 05727a4 to e0bc22d Compare May 7, 2021 21:06
@isaacs isaacs merged commit a24a4a5 into main May 10, 2021
@isaacs isaacs deleted the gar/install-prerelease-save branch May 10, 2021 16:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Packages from private repository added with version '*'
2 participants