繁体   English   中英

不支持:关键字“id”,使用“$id”作为模式 ID:TSLint(ng add @angular-eslint/schematics)

[英]NOT SUPPORTED: keyword "id", use "$id" for schema ID : TSLint (ng add @angular-eslint/schematics)

我正在将我的 Angular 10 应用程序升级到 Angular 13。我在其他依赖项兼容性方面做得很好。 该项目正在编译并且工作正常。 现在是 TSLint 的时候了,我尝试使用以下命令更新 lint。

ng add @angular-eslint/schematics

但是收到错误消息:

An unhandled exception occurred: NOT SUPPORTED: keyword "id", use "$id" for schema ID

对于 eslint:

ng 添加@angular-eslint/schematics@12 用于角度 12

ng 添加@angular-eslint/schematics@13 用于角度 13

ng 添加@angular-eslint/schematics@14 用于角度 14

ng add @angular-eslint/schematics@next

这对我有用 github.com/angular-eslint/angular-eslint/issues/790

在我使用 angular 14 时出现,在升级 angular 15 之后(在重新安装 angular cli 之前)为我解决了问题。

我解决了将 angular cli 版本降级到 12 的问题

在此处输入图片说明

我有同样的问题。 我可以通过将 angular/universal 升级到与我的 angular 版本相同的版本来修复它。

看来很多包都会抛出这个错误。 我在添加 NgRx 商店时遇到了同样的错误。 看起来安装最新版本的软件包通常可以解决问题:

ng add package_name/@latest

尝试 // - ng add @angular-eslint/schematics@next -//

I had a conflict where the third-party package I was using had been replaced by an official one, but for some reason I had both of them in my package.json file The real issue though was that the angular.json file was using the旧的建造者而不是新的建造者。 我删除了 package 并使用ng add通过其原理图添加新的 package,之后一切开始正常工作。

在生成页面/组件时,我在Angular 14、IONIC 6项目中遇到了同样的问题。 并通过在以下路径上手动将 id 替换为 $id来解决它:

  1. node_modules > @Ionic > angular-toolkit > 示意图 > 页面 > schema.json > 在第 3 行用 $id 替换 id。

  2. node_modules > @Ionic > angular-toolkit > 示意图 > 组件 > schema.json > 在第 3 行用 $id 替换 id。

手动安装与您的角度版本相对应的@angular/pwa版本,然后运行“ng add @angular/pwa”

对我来说,只需添加最新版本即可:

ng add @angular/pwa@15.0.4

版本列表可在此处获得

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM