diff --git a/packages/@angular/cli/bin/ng b/packages/@angular/cli/bin/ng index a0c453630b96..042db2466ba3 100755 --- a/packages/@angular/cli/bin/ng +++ b/packages/@angular/cli/bin/ng @@ -86,6 +86,30 @@ if (require('../package.json')['name'] == 'angular-cli' `)); } +const packageJsonProjectPath = path.join(process.cwd(), 'package.json') +if (fs.existsSync(packageJsonProjectPath)) { + const packageJsonProject = require(packageJsonProjectPath); + const hasOldDep = !!packageJsonProject.dependencies['angular-cli']; + const hasOldDevDep = !!packageJsonProject.devDependencies['angular-cli']; + const hasDevDep = !!packageJsonProject.devDependencies['@angular/cli']; + + if (hasOldDep || hasOldDevDep || !hasDevDep) { + const warnings = [ + 'The package "angular-cli" has been renamed to "@angular/cli". The old package will be deprecated soon.', + 'Please take the following steps to avoid issues:' + ]; + if (hasOldDep) { + warnings.push('"npm uninstall --save angular-cli"'); + } + if (hasOldDevDep) { + warnings.push('"npm uninstall --save-dev angular-cli"'); + } + if (!hasDevDep) { + warnings.push('"npm install --save-dev @angular/cli@latest"'); + } + process.stderr.write(yellow(warnings.join('\n\n'), '\n')); + } +} resolve('@angular/cli', { basedir: process.cwd() }, function (error, projectLocalCli) {