diff --git a/extensions/npm/src/features/packageJSONContribution.ts b/extensions/npm/src/features/packageJSONContribution.ts index 03aca24ad40..6589059a7cb 100644 --- a/extensions/npm/src/features/packageJSONContribution.ts +++ b/extensions/npm/src/features/packageJSONContribution.ts @@ -323,18 +323,16 @@ export class PackageJSONContribution implements IJSONContribution { } private async npmView(npmCommandPath: string, pack: string, resource: Uri | undefined): Promise { - // Request @latest to avoid fetching publish timestamps for all versions in the time field. - const args = ['view', '--json', '--', `${pack}@latest`, 'description', 'homepage', 'version', 'time']; - + const args = ['view', '--json', '--', pack, 'description', 'dist-tags.latest', 'homepage', 'version', 'time']; const stdout = await this.runNpmCommand(npmCommandPath, args, resource); if (stdout) { try { const content = JSON.parse(stdout); - const version = content['version']; + const version = content['dist-tags.latest'] || content['version']; return { description: content['description'], - version: content['version'], - time: version ? content['time']?.[version] : undefined, + version, + time: content.time?.[version], homepage: content['homepage'] }; } catch (e) {