Home > Software design >  Angular 15 is supposed to support typescript 4.9.3 but gives errors
Angular 15 is supposed to support typescript 4.9.3 but gives errors

Time:12-04

I am trying to update my project to use typescript 4.9.3, and the latest Angular (@15) is supposed to support it ( https://angular.io/guide/update-to-version-15 )

But whatever I do I always get the error

Error: Failed to initialize Angular compilation - The Angular Compiler requires TypeScript >=4.8.2 and <4.9.0 but 4.9.3 was found instead.

I don't get it: why does the Angular Compiler expect a Typescript version <4.9.0???

Thanks for any help! I post here my package.json, can anyone please help?

{
  "name": "myproject",
  "version": "0.0.0",
  "scripts": {
  "ng": "ng",
  "start": "ng serve",
  "build": "ng build",
  "watch": "ng build --watch --configuration development",
  "test": "ng test"
},
  "private": true,
  "dependencies": {
  "@angular/animations": "^15.0.2",
  "@angular/cdk": "^15.0.1",
  "@angular/common": "^15.0.2",
  "@angular/compiler": "^15.0.2",
  "@angular/core": "^15.0.2",
  "@angular/forms": "^15.0.2",
  "@angular/material": "^15.0.1",
  "@angular/platform-browser": "^15.0.2",
  "@angular/platform-browser-dynamic": "^15.0.2",
  "@angular/router": "^15.0.2",
  "angular-highcharts": "^14.1.5",
  "bootstrap": "^5.2.0",
  "bootstrap-icons": "^1.9.1",
  "highcharts": "^10.2.0",
  "highcharts-angular": "^3.0.0",
  "rxjs": "~7.4.0",
  "tslib": "^2.3.0",
  "zone.js": "~0.11.4"
 },
 "devDependencies": {
 "@angular-devkit/build-angular": "^15.0.2",
 "@angular/cli": "^15.0.2",
 "@angular/compiler-cli": "^15.0.2",
 "@types/jasmine": "~3.10.0",
 "@types/node": "^12.11.1",
 "jasmine-core": "~3.10.0",
 "karma": "~6.3.0",
 "karma-chrome-launcher": "~3.1.0",
 "karma-coverage": "~2.0.3",
 "karma-jasmine": "~4.0.0",
 "karma-jasmine-html-reporter": "~1.7.0",
 "typescript": "^4.9.3"
  }
}

CodePudding user response:

Nope, Angular 15.0 does not support TS 4.9.

The PR is pending. You'll probably have to wait for 15.1.

  • Related