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

Angular项目执行npm i时出现依赖树无法解析错误求助

解决Angular 13安装@ngx-translate/core的npm异常

环境信息

  • Angular CLI: 14.0.6
  • Node: 16.15.0
  • npm: 9.1.2
  • Angular: 13.3.3

问题

执行npm i @ngx-translate/core时触发npm安装异常,出现依赖解析失败或版本冲突类错误。

解决方案

1. 指定兼容版本安装

@ngx-translate/core的v14.x系列适配Angular 13,直接安装该版本:

npm install @ngx-translate/core@14.0.0

2. 降级npm版本(可选)

npm 9.x对旧版Angular生态的兼容性不佳,可降级到稳定的npm 8.x:

npm install -g npm@8.19.4

降级后重新执行包安装命令。

3. 清理缓存重置依赖

若上述方法无效,清理npm缓存并重置本地依赖:

npm cache clean --force
rm -rf node_modules package-lock.json
npm install
npm install @ngx-translate/core@14.0.0

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.10 20:35:22