【问题标题】:DeprecationWarning: 'getMutableClone' has been deprecated since v4.0.0. Use an appropriate `factory.update...` method instead,.. (look inside)DeprecationWarning: \'getMutableClone\' 自 v4.0.0 以来已被弃用。改用适当的 `factory.update...` 方法,..(看里面)
【发布时间】:2022-09-27 17:55:37
【问题描述】:

\"..使用setCommentRangesetSourceMapRange,避免设置parent。\" 我刚刚更新了我的本地 Angular CLI 版本。我的项目,现在我得到这个:\“DeprecationWarning:\'getMutableClone\'自v4.0.0以来已被弃用。改用适当的factory.update...方法,使用setCommentRangesetSourceMapRange,并避免设置parent .\" 我如何以及在哪里可以解决它?

  • 根据您的 Angular 版本,您应该检查是否安装了匹配的 TypeScript 依赖项。根据update.angular.io/?v=13.0-14.0 Angular 14 e。 G。使用 TypeScript 4.6。因此,您应该确保您的 package.json 要求在 devDependencies 中提供适当的 TypeScript 版本,例如 \"typescript\": \"~4.6.4\"

标签: angular


【解决方案1】:

我遇到了同样的问题,我发现它取决于打字稿的新版本 4.8,我已经解决了降级问题(如果需要,添加 --force )。这应该安装 typescript 4.7.4

npm i typescript@"<4.8"

【讨论】:

    【解决方案2】:

    Angular 团队是working on this。大多数用法已被删除,但这仍然是 14.2.3 的 WIP。

    此消息在 TS 4.8 中随getMutableClone 的贬值出现,拥有它的人无需降级 TS。

    【讨论】:

      猜你喜欢
      • 2021-10-29
      • 1970-01-01
      • 2017-03-24
      • 2016-04-09
      • 2017-11-27
      • 2022-08-22
      • 2022-08-04
      • 1970-01-01
      • 2021-08-15
      相关资源
      最近更新 更多