From acd8464d33972e6c021d0136ff85c4c44f085350 Mon Sep 17 00:00:00 2001 From: Abdulhaq Emhemmed Date: Sat, 24 Dec 2016 16:18:02 +0200 Subject: [PATCH] Fix(version): allow Angular major version other than 2 --- packages/angular-cli/upgrade/version.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/angular-cli/upgrade/version.ts b/packages/angular-cli/upgrade/version.ts index 39117b7ba0b6..cec8beb78b56 100644 --- a/packages/angular-cli/upgrade/version.ts +++ b/packages/angular-cli/upgrade/version.ts @@ -105,11 +105,13 @@ export class Version { if (v.isLocal()) { console.warn(yellow('Using a local version of angular. Proceeding with care...')); } else { - if (v.major != 2 || ((v.minor == 3 && v.patch == 0) || v.minor < 3)) { + if (v.major < 2 + || (v.major < 2 && v.minor < 3) + || (v.major < 2 && v.minor < 3 && v.patch < 1)) { console.error(bold(red(stripIndents` This version of CLI is only compatible with angular version 2.3.1 or better. Please upgrade your angular version, e.g. by running: - + npm install @angular/core@latest ` + '\n'))); process.exit(3); @@ -129,7 +131,7 @@ export class Version { It seems like you're using a project generated using an old version of the Angular CLI. The latest CLI now uses webpack and has a lot of improvements including a simpler workflow, a faster build, and smaller bundles. - + To get more info, including a step-by-step guide to upgrade the CLI, follow this link: https://github.com/angular/angular-cli/wiki/Upgrading-from-Beta.10-to-Beta.14 ` + '\n')));