Sabareesh
Sabareesh

Reputation: 751

Couldn't update Angular CLI due to ESLint

I am developing a web application using Angular typescript. Recently, I tried to update @angular/cli package but got the following error:

(env) ➜  tsclient git:(feature/my-branch) npm install --save-dev @angular/cli@latest

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/cli
npm ERR!   dev @angular/cli@"12.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/cli@">= 11.2.0 < 12.0.0" from @angular-eslint/[email protected]
npm ERR! node_modules/@angular-eslint/builder
npm ERR!   dev @angular-eslint/builder@"4.2.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 /home/sabareesh/.npm/eresolve-report.txt for a full report.

This is my package.json:

{
  "name": "my-app",
  "version": "13.3.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^11.2.9",
    "@angular/cdk": "^11.2.8",
    "@angular/common": "^11.2.9",
    "@angular/compiler": "^11.2.9",
    "@angular/core": "^11.2.9",
    "@angular/forms": "^11.2.9",
    "@angular/material": "^11.2.8",
    "@angular/platform-browser": "^11.2.9",
    "@angular/platform-browser-dynamic": "^11.2.9",
    "@angular/router": "^11.2.9",
    "rxjs": "~6.6.0",
    "tslib": "^2.0.0",
    "zone.js": "~0.11.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.1102.8",
    "@angular-eslint/builder": "4.2.0",
    "@angular-eslint/eslint-plugin": "4.2.0",
    "@angular-eslint/eslint-plugin-template": "4.2.0",
    "@angular-eslint/schematics": "4.2.0",
    "@angular-eslint/template-parser": "4.2.0",
    "@angular/cli": "^11.2.10",
    "@angular/compiler-cli": "^11.2.9",
    "@types/jasmine": "~3.6.0",
    "@types/node": "^12.11.1",
    "@typescript-eslint/eslint-plugin": "4.16.1",
    "@typescript-eslint/parser": "4.16.1",
    "eslint": "^7.6.0",
    "eslint-plugin-import": "latest",
    "eslint-plugin-jsdoc": "latest",
    "eslint-plugin-prefer-arrow": "latest",
    "jasmine-core": "~3.7.1",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~6.1.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.6.0",
    "ng-packagr": "^11.2.4",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "typescript": "^4.1.5"
  },
  "eslintIgnore": [
    "*.spec.ts",
    "app.po.ts",
    "environment.ts",
    "polyfills.ts",
    "test.ts"
  ]
}

I think the error is due to the fact @angular-eslint/builder is dependent on a lower angular CLI version. So, I tried updating @angular-eslint/builder but that didn't get updated too.

Upvotes: 2

Views: 2763

Answers (1)

@angular-eslint/[email protected] package.json

and

@angular-eslint/builder@latest package.json

see diff? try to upgrade to v12 all angular packages with other OR use flag --force to ignore error above

Upvotes: 1

Related Questions