diff --git a/libraries/rush-lib/src/logic/PackageJsonUpdater.ts b/libraries/rush-lib/src/logic/PackageJsonUpdater.ts index b6e3476c48..1f5621b512 100644 --- a/libraries/rush-lib/src/logic/PackageJsonUpdater.ts +++ b/libraries/rush-lib/src/logic/PackageJsonUpdater.ts @@ -540,7 +540,6 @@ export class PackageJsonUpdater { } private async _getRemoteLatestVersionAsync(packageName: string): Promise { - let selectedVersion: string | undefined; this._terminal.writeLine(`Querying NPM registry for latest version of "${packageName}"...`); let commandArgs: string[]; @@ -550,7 +549,7 @@ export class PackageJsonUpdater { commandArgs = ['view', `${packageName}@latest`, 'version']; } - selectedVersion = ( + const selectedVersion: string = ( await Utilities.executeCommandAndCaptureOutputAsync( this._rushConfiguration.packageManagerToolFilename, commandArgs,