Angular-cli: Angular cli 1.6 and Typescript 2.5.3 warning

Created on 7 Dec 2017  路  8Comments  路  Source: angular/angular-cli

I've recently updated to Angular 5.1.0 and Angular CLI 1.6.0 which is supposed to be typescript 2.5 friendly however I'm receiving the following warning

@angular/[email protected] requires typescript@'>=2.4.2 <2.5.0' but 2.5.3 was found instead.

Versions

Angular CLI: 1.6.0
Node: 7.9.0
OS: win32 x64
Angular: 5.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router

@angular/cli: 1.6.0
@angular-devkit/build-optimizer: 0.0.35
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.41
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.0
@schematics/angular: 0.1.10
@schematics/schematics: 0.0.10
typescript: 2.5.3
webpack: 3.10.0
  "dependencies": {
    "@angular/animations": "^5.1.0",
    "@angular/common": "^5.1.0",
    "@angular/compiler": "^5.1.0",
    "@angular/core": "^5.1.0",
    "@angular/forms": "^5.1.0",
    "@angular/http": "^5.1.0",
    "@angular/platform-browser": "^5.1.0",
    "@angular/platform-browser-dynamic": "^5.1.0",
    "@angular/platform-server": "^5.1.0",
    "@angular/router": "^5.1.0",
    "core-js": "^2.5.1",
    "rxjs": "^5.5.5",
    "zone.js": "^0.8.18"
  },
  "devDependencies": {
    "@angular/cli": "^1.6.0",
    "@angular/compiler-cli": "^5.1.0",
    "@types/jasmine": "2.5.38",
    "@types/node": "^6.0.92",
    "codelyzer": "~3.0.1",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "^1.7.1",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "^1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~3.0.4",
    "tslint": "~5.3.2",
    "typescript": "~2.5.0"
  }

Repro steps

  • ng serve --aot
2 (required) inconvenient

Most helpful comment

Is there some way to make CLI not add its own additional requirement on top of what the underlying package requires? It was pointed out over in the Angular repo that the Angular package already has the correct dependency. I'd rather see CLI just accept the upstream requirement from Angular itself, rather than have things like this that have to be changed to match Angular, if possible?

All 8 comments

Will be fixed by #8766

In case the team isn't aware, TS is already up to 2.6.2. So even expanding the peer dependency range to <2.6 is already outdated. So the range probably should become <2.7?

@brian428 Angular itself doesn't support 2.6 yet, this will arrive in one of the upcoming minor releases. https://blog.angular.io/angular-5-1-more-now-available-27d372f5eb4e

Is there some way to make CLI not add its own additional requirement on top of what the underlying package requires? It was pointed out over in the Angular repo that the Angular package already has the correct dependency. I'd rather see CLI just accept the upstream requirement from Angular itself, rather than have things like this that have to be changed to match Angular, if possible?

So this didn't make it into the 1.6.1 release?

I agree with @kylecordes that this warning is probably redundant as Angular already requires correct version using peerDependencies. Tested with CLI 1.6.1:

$ ng new tsv
$ cd tsv
# edit package.json to install typescript 2.6.1
$ npm i
npm WARN @angular/[email protected] requires a peer of typescript@>=2.4.2 <2.6 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of typescript@>=2.4.2 <2.6 but none is installed. You must install peer dependencies yourself.

I got the same kind of warning. Do you have good solution to solve this typescript mismatch?
............................................................................................................................
$ ng build "--prod"
@angular/[email protected] requires typescript@'>=2.7.0 <2.8.0' but 2.9.2 was found instead.
Using this version can result in undefined behaviour and difficult to debug problems.
Please run the following command to install a compatible version of TypeScript.
npm install typescript@'>=2.7.0 <2.8.0'
To disable this warning run "ng config cli.warnings.typescriptMismatch false".

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daBishMan picture daBishMan  路  3Comments

sysmat picture sysmat  路  3Comments

rajjejosefsson picture rajjejosefsson  路  3Comments

delasteve picture delasteve  路  3Comments

MateenKadwaikar picture MateenKadwaikar  路  3Comments