You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Angular 15宣称支持TypeScript 4.9.3却出现版本兼容报错求助

Angular 15与TypeScript 4.9.3版本兼容问题排查

我正尝试将项目升级至TypeScript 4.9.3,根据Angular官方文档,最新的Angular 15版本应当支持该TypeScript版本。但无论进行何种操作,始终出现如下报错:

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.

我无法理解为何Angular编译器要求TypeScript版本需小于4.9.0?附上我的package.json配置文件,恳请各位帮忙排查问题:

{
  "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"
  }
}

内容的提问来源于stack exchange,提问作者AlePorro

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 17:05:14