#Proper Way to Update Dependencies

22 messages · Page 1 of 1 (latest)

opal wing
#

Hi Angular community!
I opened up a much older repository at my new company and I'm noticing a ton of dependency issues when it hits the "npm install".

Is there a safe way to fix all these without breaking everything as this is a repository I don't frequently touch. Thank you for your assistance!

quick thicket
#

Just to make sure, this is not an "nx workspace" project, right?

According to the docs, since v12 of Angular the versions of the eslint package should match with the angular version. I'd recommend asking in your company if someone knows why this wasn't done (some issue?) and if you don't find any answers, update it.

It is only tooling / "internal" anyways and would not be part of a production build, hence it should not affect "customer code" in any way.

See: https://github.com/angular-eslint/angular-eslint#supported-angular-cli-versions

GitHub

:sparkles: Monorepo for all the tooling related to using ESLint with Angular - GitHub - angular-eslint/angular-eslint: Monorepo for all the tooling related to using ESLint with Angular

opal wing
#

@quick thicket Thanks for the reply. So the version number should be identical for eslint & Angular based on this article?

#
  "name": "qci-module",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "preinstall": "npm install --package-lock-only --ignore-scripts && npx npm-force-resolutions",
    "start": "ng serve",
    "build": "ng build --configuration production",
    "test": "ng test",
    "lint": "ng lint"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "13.2.5",
    "@angular/cdk": "12.2.8",
    "@angular/common": "13.2.5",
    "@angular/compiler": "13.2.5",
    "@angular/core": "13.2.5",
    "@angular/forms": "13.2.5",
    "@angular/material": "12.2.8",
    "@angular/platform-browser": "13.2.5",
    "@angular/platform-browser-dynamic": "13.2.5",
    "@angular/router": "13.2.5",
    "async": "^3.2.3",
    "ng-packagr": "^13.3.0",
    "rxjs": "7.5.5",
    "tslib": "2.3.1",
    "zone.js": "0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^13.3.1",
    "@angular-eslint/builder": "^12.2.1",
    "@angular-eslint/eslint-plugin": "13.1.0",
    "@angular-eslint/eslint-plugin-template": "13.1.0",
    "@angular-eslint/schematics": "13.1.0",
    "@angular-eslint/template-parser": "13.1.0",
    "@angular/cli": "13.2.5",
    "@angular/compiler-cli": "13.2.5",
    "@types/jasmine": "3.9.1",
    "@types/node": "16.10.2",
    "@typescript-eslint/eslint-plugin": "5.11.0",
    "@typescript-eslint/parser": "5.11.0",
    "eslint": "^8.2.0",
    "eslint-plugin-import": "latest",
    "eslint-plugin-jsdoc": "latest",
    "eslint-plugin-prefer-arrow": "latest",
    "jasmine-core": "3.9.0",
    "jasmine-spec-reporter": "7.0.0",
    "karma": "^6.3.17",
    "karma-chrome-launcher": "3.1.0",
    "karma-coverage": "2.0.3",
    "karma-jasmine": "4.0.1",
    "karma-jasmine-html-reporter": "1.7.0",
    "protractor": "7.0.0",
    "ts-node": "10.2.1",
    "typescript": "4.5.5"
  },
  "resolutions": {
    "minimist": "1.2.6"
  }
}
#

It appears that currently it's 13.1.0 here in the package.json.

#

Would I simply update that in the package.json and attempt again?

#

To match the cli.

quick thicket
#

The problem is the "@angular-eslint/builder". I am not sure why this is not 13.1.0 as well. I'd say it should be.

opal wing
#

Let me try bumping that one to 13.1.0 and trying another npm install.

quick thicket
#

The caret (^) only states that all version >= 12.2.1 and < 13.0.0 are valid.

#

(you should remove the caret and use a fixed version number)

opal wing
#

Gotcha.

#

Job's running now. Let's hope it goes through.

#

On git.

#

I've always hated dealing with dependencies in front end.

#

Job succeeded

quick thicket
#

great 🙂

opal wing
#

Wow, that's all it was.

#

Thanks @quick thicket !