npm / npm/cli

[BUG] "min-release-age-exclude" not working with "omit-lockfile-registry-resolved"

Open
#9,715 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs Triage
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Is there an existing issue for this?
  • I have searched the existing issues
This issue exists in the latest npm version
  • I am using the latest npm
This is not just a request to bump a dependency for a CVE
  • This is not solely a request to bump a dependency for a CVE
Current Behavior

I'm working on a project that requires omit-lockfile-registry-resolved=true

When paired with

min-release-age=3
min-release-age-exclude[]=@my-org/*

npm ci and partially npm i is not respecting the min-release-age-exclude config

Initially i run npm i which works properly and respects the min-release-age-exclude meaning that it will allow installations of @my-org/* packages that are 1 day old.

Subsequential runs of npm i also works just fine.

However when i run npm ci it starts to complain that the package @my-org/* doesnt fall within min-release-age.

Subsequential runs of npm i now stops working too

I've verified that if i remove omit-lockfile-registry-resolved=true everything works as expected

Expected Behavior

I'd expect npm i and npm ci to behave similar to when not having omit-lockfile-registry-resolved=true, meaning that both commands should respect min-release-age-exclude

Steps To Reproduce
  1. In this environment...
    node: v24.16.0
    npm: 11.18.0

  2. With this config...
    A package.json containing a package from @my-org/* with a version publish within the last 2 days

omit-lockfile-registry-resolved=true
min-release-age=3
min-release-age-exclude[]=@my-org/*
  1. Run '...'
    npm i and then npm ci

  2. See error...

npm error code ETARGET
npm error notarget No matching version found for @my-org/.... with a date before ......
Environment

@my-org/* packages are publish to a private registry and configured through my global .npmrc

  • npm: 11.18.0
  • Node.js: 24.16.0
  • OS Name: MacOS 26.5.1
  • npm config:
npm config get
; "user" config from /Users/dev/.npmrc

//my-registry:_authToken = (protected)
registry = "https://my-registry"

; "project" config from /Users/dev/project/.npmrc

engine-strict = true
min-release-age = 3
min-release-age-exclude = ["@my-org/*"]
omit-lockfile-registry-resolved = true
prefer-dedupe = true
strict-allow-scripts = true

; node version = v24.16.0
; npm local prefix = /Users/dev/project
; npm version = 11.18.0
; cwd = /Users/dev/project
; HOME = /Users/dev
; Run `npm config ls -l` to show all defaults.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior with npm i followed by npm ci using npm 11.18.0, Node.js 24.16.0, and the provided .npmrc settings. Compare behavior with omit-lockfile-registry-resolved disabled, then trace the install and configuration handling for min-release-age-exclude. Done means both commands accept the recently published @my-org/* package while the age restriction remains applied to other packages.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.