diff --git a/packages/angular/cli/lib/init.ts b/packages/angular/cli/lib/init.ts index f0620e7a14f8..e4ee414f05e9 100644 --- a/packages/angular/cli/lib/init.ts +++ b/packages/angular/cli/lib/init.ts @@ -78,11 +78,13 @@ let forceExit = false; console.error('Version mismatch check skipped. Unable to compare local version: ' + error); } - if (isGlobalGreater) { + const rawCommandName = process.argv[2]; + // When using the completion command, don't show the warning as otherwise this will break completion. + if (isGlobalGreater && rawCommandName !== 'completion') { // If using the update command and the global version is greater, use the newer update command // This allows improvements in update to be used in older versions that do not have bootstrapping if ( - process.argv[2] === 'update' && + rawCommandName === 'update' && cli.VERSION && cli.VERSION.major - globalVersion.major <= 1 ) {