question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@angular-eslint/template-parser requires Angular v12 even when using @angular-eslint/schematics@4.3.0.

See original GitHub issue

Description and reproduction of the issue

  1. Create an Angular 11 project ng new
  2. ng add @angular-eslint/schematics@4.3.0
  3. You’ll receive the following error:
$ ng add @angular-eslint/schematics

ℹ Using package manager: npm
✔ Found compatible package version: @angular-eslint/schematics@4.3.0.
✔ Package information loaded.
✖ Package installation failed: npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: @angular/compiler@12.0.3
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.1.0
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!         dev @angular-eslint/schematics@"4.3.0" from the root project
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
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See xxx/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!    xxx/.npm/_logs/2021-06-07T14_05_32_449Z-debug.log
Package install failed, see above.

Versions

package version
@angular-eslint/template-parser 12.1.0
ESLint none
node 12.8.13
# Please run `npx ng version` in your project and paste the full output here:

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 11.2.14
Node: 12.18.3
OS: darwin x64

Angular: 11.2.14
... animations, cli, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1102.14
@angular-devkit/build-angular   0.1102.14
@angular-devkit/core            11.2.14
@angular-devkit/schematics      11.2.14
@angular/cdk                    11.2.13
@angular/flex-layout            11.0.0-beta.33
@angular/material               11.2.13
@schematics/angular             11.2.14
@schematics/update              0.1102.14
rxjs                            6.6.7
typescript                      4.0.7
  • I have updated to the latest supported version of the packages and checked my ng version output per the instructions given here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
P4commented, Jun 7, 2021

I found a workaround of manually installing the right version of @angular-eslint/template-parser before running ng add:

npm i -D @angular-eslint/template-parser@4
0reactions
amit2206commented, May 18, 2022

Hi, I am also getting same error with my angular version 13, I tried above suggestion (npm i -D @angular-eslint/template-parser@12), but getting following error- npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: sdwan-ui-refactor@0.0.0 npm ERR! Found: @angular-devkit/build-angular@12.0.1 npm ERR! node_modules/@angular-devkit/build-angular npm ERR! dev @angular-devkit/build-angular@“^13.2.5” from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! dev @angular-devkit/build-angular@“^13.2.5” from the root project npm ERR! npm ERR! Conflicting peer dependency: @angular/compiler-cli@13.3.9 npm ERR! node_modules/@angular/compiler-cli npm ERR! peer @angular/compiler-cli@“^13.0.0 || ^13.3.0-rc.0” from @angular-devkit/build-angular@13.3.6 npm ERR! node_modules/@angular-devkit/build-angular npm ERR! dev @angular-devkit/build-angular@“^13.2.5” from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See /home/guest/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in: npm ERR! /home/guest/.npm/_logs/2022-05-18T20_12_19_427Z-debug.log

Any suggestion please ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

@angular-eslint/template-parser - npm
Start using @angular-eslint/template-parser in your project by running `npm i @angular-eslint/template-parser`. There are 93 other projects ...
Read more >
@angular-eslint/template-parser - npm package | Snyk
We found that @angular-eslint/template-parser demonstrates a positive version release cadence with at least one new version released in the past ...
Read more >
ESLint error when trying to lint Angular templates
Your config here overrides the parser used for angular templates. This means that you're not using @typescript-eslint/parser to parse your ...
Read more >
angular-eslint/template-parser v14.1.2 - npm.io
For Angular project's specifically, the migration involves a few different aspects: Replacing the builder the Angular CLI will use when you run ng...
Read more >
Angular Basics: Using ESLint to Boost Code Quality - Telerik
TSLint got deprecated to focus on improving ESLint's (another linter) TypeScript support. Angular Without Linters. TSLint was still supported by ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found