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

安装@angular-builders/custom-webpack后Angular版本兼容报错求助

解决Angular CLI版本兼容报错问题

你遇到的报错核心原因是**@angular-builders/custom-webpack**版本与当前Angular版本不匹配:你安装的^14.1.0版本仅支持Angular 14,而项目使用的是Angular 15.0.1,这触发了CLI的版本兼容性检测错误。

解决步骤:

  1. 卸载旧版本的@angular-builders/custom-webpack:
npm uninstall @angular-builders/custom-webpack
  1. 安装适配Angular 15的版本(该包的15.x系列对应Angular 15):
npm install @angular-builders/custom-webpack@^15.0.0 --save-dev
  1. 重新运行ng serve验证问题是否解决

额外排查方案(若上述步骤无效):

  • 删除项目根目录下的node_modules文件夹和package-lock.json文件:
    • Linux/macOS:rm -rf node_modules package-lock.json
    • Windows:rmdir /s /q node_modules && del package-lock.json
  • 重新安装所有依赖:
npm install

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.11 02:15:35