From d79f22c8b7661f31a54d19b7020c881f95a5874f Mon Sep 17 00:00:00 2001 From: Qiming Zhao Date: Thu, 20 Oct 2022 14:11:06 +0800 Subject: [PATCH] fix invalid versionInfo --- src/extension/dependency.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/extension/dependency.ts b/src/extension/dependency.ts index 1eb605cf113..62132ed72bd 100644 --- a/src/extension/dependency.ts +++ b/src/extension/dependency.ts @@ -115,7 +115,7 @@ export function readDependencies(directory: string): { [key: string]: string } { } export function getVersion(requirement: string, versions: string[], latest?: string): string | undefined { - if (latest && validVersionInfo(versions[latest]) && semver.satisfies(latest, requirement)) return latest + if (latest && semver.satisfies(latest, requirement)) return latest let sorted = semver.rsort(versions.filter(v => semver.valid(v, { includePrerelease: false }))) for (let v of sorted) { if (semver.satisfies(v, requirement)) return v @@ -285,7 +285,6 @@ export class DependenciesInstaller { let version = getVersion(requirement, Object.keys(info.versions), info.latest) if (version) { let versionInfo = info.versions[version] - versionInfo.version = version if (validVersionInfo(versionInfo)) return versionInfo } }