@@ -94,22 +94,33 @@ if (packageJsonProjectPath && fs.existsSync(packageJsonProjectPath)) {
9494 const deps = packageJsonProject [ 'dependencies' ] || { } ;
9595 const devDeps = packageJsonProject [ 'devDependencies' ] || { } ;
9696 const hasOldDep = ! ! deps [ 'angular-cli' ] ;
97+ const hasDep = ! ! deps [ '@angular/cli' ] ;
9798 const hasOldDevDep = ! ! devDeps [ 'angular-cli' ] ;
9899 const hasDevDep = ! ! devDeps [ '@angular/cli' ] ;
99100
100- if ( hasOldDep || hasOldDevDep || ! hasDevDep ) {
101+ if ( hasOldDep || hasOldDevDep || ! hasDevDep || ! hasDep ) {
101102 const warnings = [
102- 'The package "angular-cli" has been renamed to "@angular/cli". The old package will be '
103- + 'deprecated soon.' ,
104- '' ,
105- 'Please take the following steps to avoid issues:'
103+ 'Unable to find "@angular/cli" in devDependencies.' ,
104+ ''
106105 ] ;
106+
107+ if ( hasOldDep || hasOldDevDep ) {
108+ warnings . push (
109+ 'The package "angular-cli" has been deprecated and renamed to "@angular/cli".' ,
110+ '' ) ;
111+ }
112+
113+ warnings . push ( 'Please take the following steps to avoid issues:' ) ;
114+
107115 if ( hasOldDep ) {
108116 warnings . push ( '"npm uninstall --save angular-cli"' ) ;
109117 }
110118 if ( hasOldDevDep ) {
111119 warnings . push ( '"npm uninstall --save-dev angular-cli"' ) ;
112120 }
121+ if ( hasDep ) {
122+ warnings . push ( '"npm uninstall --save @angular/cli"' )
123+ }
113124 if ( ! hasDevDep ) {
114125 warnings . push ( '"npm install --save-dev @angular/cli@latest"' ) ;
115126 }
@@ -148,7 +159,7 @@ resolve('@angular/cli', { basedir: process.cwd() },
148159 console . log ( yellow ( stripIndents `
149160 Your global Angular CLI version (${ globalVersion } ) is greater than your local
150161 version (${ localVersion } ). The local Angular CLI version is used.
151-
162+
152163 To disable this warning use "ng set --global warnings.versionMismatch=false".
153164 ` ) ) ;
154165 }
0 commit comments