From a32f3aed024fc1f5153627cd4d4bbf0e6ca3a353 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 1 Jun 2026 18:23:22 +0100 Subject: [PATCH] revert changes to npmView (#319352) --- extensions/npm/src/features/packageJSONContribution.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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) {