简体   繁体   English

将 tslint 迁移到 @angular-eslint/schematics:ERESOLVE 无法解析依赖树:@angular/compiler@12.1.2

[英]Migrate tslint to @angular-eslint/schematics: ERESOLVE unable to resolve dependency tree: @angular/compiler@12.1.2

I'm trying to migrate tslint to eslint in my angular 11 library using the official documentation here .我正在尝试使用此处的官方文档将 tslint 迁移到我的 angular 11 库中的 eslint。

When I run the cmd ng add @angular-eslint/schematics@4.3.0 I'm getting the following error:当我运行 cmd ng add @angular-eslint/schematics@4.3.0时,我收到以下错误:

✖ Package installation failed: npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: @angular/compiler@12.1.2
npm ERR! node_modules/@angular-eslint/schematics/node_modules/@angular/compiler
npm ERR!   peer @angular/compiler@">= 12.0.0 < 13.0.0" from @angular-eslint/template-parser@12.3.1
npm ERR!   node_modules/@angular-eslint/schematics/node_modules/@angular-eslint/template-parser
npm ERR!     peer @angular-eslint/template-parser@"*" from @angular-eslint/eslint-plugin-template@4.3.0
npm ERR!     node_modules/@angular-eslint/schematics/node_modules/@angular-eslint/eslint-plugin-template
npm ERR!       @angular-eslint/eslint-plugin-template@"4.3.0" from @angular-eslint/schematics@4.3.0
npm ERR!       node_modules/@angular-eslint/schematics
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler@">= 11.2.0 < 12.0.0" from @angular-eslint/eslint-plugin-template@4.3.0
npm ERR! node_modules/@angular-eslint/schematics/node_modules/@angular-eslint/eslint-plugin-template
npm ERR!   @angular-eslint/eslint-plugin-template@"4.3.0" from @angular-eslint/schematics@4.3.0
npm ERR!   node_modules/@angular-eslint/schematics
npm ERR!     dev @angular-eslint/schematics@"4.3.0" from the root project

Does anyone know how to solve it?有谁知道如何解决它?

I found out here that you just need to run the following command:我在这里发现你只需要运行以下命令:

npm i -D @angular-eslint/template-parser@4

And then you can run:然后你可以运行:

ng add @angular-eslint/schematics@4.3.0

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

相关问题 如何运行@angular-eslint/schematics:convert-tslint-to-eslint - How to run @angular-eslint/schematics:convert-tslint-to-eslint 如何添加@angular-eslint/schematics? 错误 - How add @angular-eslint/schematics? Error 不支持:关键字“id”,使用“$id”作为模式 ID:TSLint(ng add @angular-eslint/schematics) - NOT SUPPORTED: keyword "id", use "$id" for schema ID : TSLint (ng add @angular-eslint/schematics) ERESOLVE 无法解析依赖树:Angular NEST.js、Mongoose - ERESOLVE unable to resolve dependency tree: Angular NEST.js, Mongoose ERESOLVE 无法解析依赖树? - ERESOLVE unable to resolve dependency tree? 尝试在 Angular 中安装 Clarity 库,“ng add @clr/angular”出现错误“ERESOLVE 无法解析依赖关系树” - Trying to install the Clarity library in Angular with "ng add @clr/angular" getting error "ERESOLVE unable to resolve dependency tree" Angular NPM 安装但 ERESOLVE 无法解析依赖树 npm ERR! 命令失败错误 - Angular NPM install but getting ERESOLVE unable to resolve dependency tree npm ERR! command failed Errors 我无法运行构建的 Angular 项目 - ERESOLVE 无法解析依赖树 - I can't run a built Angular project - ERESOLVE unable to resolve dependency tree npm 安装 - ERESOLVE 无法解析依赖树 - npm install - ERESOLVE unable to resolve dependency tree 更新 Angular 8 到 Angular 9 无法解析依赖树 - Updating Angular 8 to Angular 9 unable to resolve dependency tree
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM