66 * found in the LICENSE file at https://angular.io/license
77 */
88
9- import { logging , tags } from '@angular-devkit/core' ;
10- import { SemVer , gte , satisfies } from 'semver' ;
9+ /* eslint-disable no-console */
1110
12- export function assertCompatibleAngularVersion ( projectRoot : string , logger : logging . LoggerApi ) {
11+ import { tags } from '@angular-devkit/core' ;
12+ import { SemVer , satisfies } from 'semver' ;
13+
14+ export function assertCompatibleAngularVersion ( projectRoot : string ) : void | never {
1315 let angularCliPkgJson ;
1416 let angularPkgJson ;
1517 let rxjsPkgJson ;
@@ -22,15 +24,15 @@ export function assertCompatibleAngularVersion(projectRoot: string, logger: logg
2224 angularPkgJson = require ( angularPackagePath ) ;
2325 rxjsPkgJson = require ( rxjsPackagePath ) ;
2426 } catch {
25- logger . error ( tags . stripIndents `
27+ console . error ( tags . stripIndents `
2628 You seem to not be depending on "@angular/core" and/or "rxjs". This is an error.
2729 ` ) ;
2830
2931 process . exit ( 2 ) ;
3032 }
3133
3234 if ( ! ( angularPkgJson && angularPkgJson [ 'version' ] && rxjsPkgJson && rxjsPkgJson [ 'version' ] ) ) {
33- logger . error ( tags . stripIndents `
35+ console . error ( tags . stripIndents `
3436 Cannot determine versions of "@angular/core" and/or "rxjs".
3537 This likely means your local installation is broken. Please reinstall your packages.
3638 ` ) ;
@@ -63,7 +65,7 @@ export function assertCompatibleAngularVersion(projectRoot: string, logger: logg
6365 const supportedAngularSemver = `^${ cliMajor } .0.0-next || >=${ cliMajor } .0.0 <${ cliMajor + 1 } .0.0` ;
6466
6567 if ( ! satisfies ( angularVersion , supportedAngularSemver , { includePrerelease : true } ) ) {
66- logger . error (
68+ console . error (
6769 tags . stripIndents `
6870 This version of CLI is only compatible with Angular versions ${ supportedAngularSemver } ,
6971 but Angular version ${ angularVersion } was found instead.
0 commit comments