Skip to content

Override Package Dependency in npm

In my angular project, I want to upgrade the angular version to 18, but one of the package I used haven't released a version for NG18, that cause I can't upgrade the whole project.

There are two solutions to upgrade the project,

  1. Upgrade the NG packages and ignore the package with npm option --force
  2. Override the package's version in the package.json like
JSON
"overrides": {
  "angularx-qrcode": {
    "@angular/core": "^18.0.4" <-- Override it to newer version
  }
}