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

Angular编译失败求助:TypeScript版本不兼容及插件初始化报错

错误成因分析

Error: Emit attempted before Angular Webpack plugin initialization.
Error: Failed to initialize Angular compilation - The Angular Compiler requires TypeScript >=5.2.0 and <5.3.0 but 5.4.5 was found instead.
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
× Failed to compile.

  • 核心成因是TypeScript版本不兼容:你当前使用的TypeScript 5.4.5超出了项目依赖的Angular编译器支持的版本范围(要求≥5.2.0且<5.3.0)。Angular编译器对TypeScript版本有严格的匹配限制,高版本TypeScript会直接导致编译器初始化失败。
  • 报错Emit attempted before Angular Webpack plugin initialization是连锁问题:因为Angular编译器初始化失败,Webpack相关插件还未完成初始化流程,就被触发执行编译输出操作,进而引发该错误。

内容的提问来源于stack exchange,提问作者Vinutha K Shetty

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.24 18:32:32