diff --git a/.yarn/versions/7fc37e0a.yml b/.yarn/versions/7fc37e0a.yml new file mode 100644 index 000000000000..76dd82df8099 --- /dev/null +++ b/.yarn/versions/7fc37e0a.yml @@ -0,0 +1,23 @@ +releases: + "@yarnpkg/cli": patch + "@yarnpkg/plugin-essentials": patch + "@yarnpkg/plugin-npm": patch + +declined: + - "@yarnpkg/plugin-compat" + - "@yarnpkg/plugin-constraints" + - "@yarnpkg/plugin-dlx" + - "@yarnpkg/plugin-init" + - "@yarnpkg/plugin-interactive-tools" + - "@yarnpkg/plugin-node-modules" + - "@yarnpkg/plugin-npm-cli" + - "@yarnpkg/plugin-pack" + - "@yarnpkg/plugin-patch" + - "@yarnpkg/plugin-pnp" + - "@yarnpkg/plugin-stage" + - "@yarnpkg/plugin-typescript" + - "@yarnpkg/plugin-version" + - "@yarnpkg/plugin-workspace-tools" + - "@yarnpkg/builder" + - "@yarnpkg/core" + - "@yarnpkg/doctor" diff --git a/packages/plugin-npm/sources/NpmSemverResolver.ts b/packages/plugin-npm/sources/NpmSemverResolver.ts index eab6e2efcaed..16020cefad19 100644 --- a/packages/plugin-npm/sources/NpmSemverResolver.ts +++ b/packages/plugin-npm/sources/NpmSemverResolver.ts @@ -83,7 +83,9 @@ export class NpmSemverResolver implements Resolver { } async getSatisfying(descriptor: Descriptor, references: Array, opts: ResolveOptions) { - const range = new semver.Range(descriptor.range.slice(PROTOCOL.length)); + const range = semverUtils.validRange(descriptor.range.slice(PROTOCOL.length)); + if (range === null) + throw new Error(`Expected a valid range, got ${descriptor.range.slice(PROTOCOL.length)}`); return references .map(reference => {