Skip to content

ng update ignores npm min-release-age and every package manager's release-age excludes #34822

Backlog

Description

@GuillaumeNury

Command

update

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

ng update filters candidate versions by publish time since #33364, but the filter misses most real configurations:

  1. npm: the CLI reads npm config get before. When a project sets only min-release-age (npm >= 11.10.0), npm derives before internally, but npm config get before still prints null. The filter stays off: ng update picks a version newer than the window, then npm install rejects it with ETARGET. The user sees only "Unable to install packages", and package.json is restored.

  2. Excludes: no package manager's exclude list is read, so isReleaseAgeSatisfied filters every package by date:

    • npm min-release-age-exclude (npm >= 11.17.0)
    • pnpm minimumReleaseAgeExclude
    • yarn npmPreapprovedPackages
    • bun minimumReleaseAgeExcludes
      Once (1) is fixed, a package excluded on purpose (e.g. an organization's own scope) would be held back by the CLI even though the package manager would install it.

Real-world case: a project sets min-release-age=3 with min-release-age-exclude[]=@our-scope/*. ng update @our-scope/lib cascades through the library's ng-update packageGroup to @angular/*@22.3.2, published 19 hours earlier, and fails at install time.

Minimal Reproduction

  1. In an Angular workspace using npm >= 11.10.0, add to .npmrc:
    min-release-age=36500
  2. Run ng update @angular/core (any package with a newer version works).
  3. The CLI prints "Updating package.json with dependency @angular/core to version ", then "Installing packages [FAILED: Unable to install packages]" and "Restored package.json to its original state."
  4. npm config get before prints null; npm install @angular/core@<latest> --dry-run fails with ETARGET ("No matching version found ... with a date before ...").

With before=<date> set instead of min-release-age, the CLI filter does activate, which narrows the cause to reading before only.

For excludes, add min-release-age-exclude[]=@angular/* (npm >= 11.17.0): npm then installs any version, so the CLI must not filter those packages either.

Exception or Error

✖ Installing packages [FAILED: Unable to install packages]
Restored package.json to its original state.

(underlying npm error)
npm error code ETARGET
npm error notarget No matching version found for @angular/core@22.3.2 with a date before 11/29/2026, 6:01:22 PM.

Your Environment

Angular CLI       : 22.2.6
Angular           : 22.2.4
Node.js           : 24.22.2
Package Manager   : npm 11.19.1
Operating System  : darwin arm64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/animations       │ 22.2.4            │ ^22.2.4           │
│ @angular/build            │ 22.2.6            │ ^22.2.6           │
│ @angular/cdk              │ 22.2.6            │ ^22.2.6           │
│ @angular/cli              │ 22.2.6            │ ^22.2.6           │
│ @angular/common           │ 22.2.4            │ ^22.2.4           │
│ @angular/compiler         │ 22.2.4            │ ^22.2.4           │
│ @angular/compiler-cli     │ 22.2.4            │ ^22.2.4           │
│ @angular/core             │ 22.2.4            │ ^22.2.4           │
│ @angular/forms            │ 22.2.4            │ ^22.2.4           │
│ @angular/language-service │ 22.2.4            │ ^22.2.4           │
│ @angular/platform-browser │ 22.2.4            │ ^22.2.4           │
│ @angular/router           │ 22.2.4            │ ^22.2.4           │
│ rxjs                      │ 7.8.2             │ ^7.8.2            │
│ typescript                │ 6.0.3             │ ^6.0.3            │
│ vitest                    │ 5.1.0             │ ^5.1.0            │
│ zone.js                   │ 0.16.3            │ ^0.16.3           │
└───────────────────────────┴───────────────────┴───────────────────┘

Anything else relevant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions