Skip to content

docs: clarify release age behavior for npm ci - #9844

Open
lreading-turnkey wants to merge 1 commit into
npm:latestfrom
lreading-turnkey:docs/clarify-ci-release-age
Open

docs: clarify release age behavior for npm ci#9844
lreading-turnkey wants to merge 1 commit into
npm:latestfrom
lreading-turnkey:docs/clarify-ci-release-age

Conversation

@lreading-turnkey

Copy link
Copy Markdown

Relates to #9281

The documentation should explicitly define the behavior described in #9281, regarding npm ci ignoring the before and min-release-age config options.

Here's why I think this is a good addition 😄

  1. I assumed npm ci honored all config options in an .npmrc
  2. The documentation currently instructs users to pass flags that affect the shape of the dependency tree when using npm ci, but it does not work as expected with before and min-release-age
  3. The documentation for the flags do not explicitly define the current behavior
  4. This appears to be intentional behavior, as seen in [Support] min-release-age for npm ci #9281

This is also security adjacent. Most people configure release age requirements as a defense against supply chain attacks. Having this behavior undocumented likely leaves a lot of maintainers believing their CI systems are protected, when there's still an attack path. A malicious actor can update the lockfile with a malicious package that doesn't meet the release age requirements, and that will run in CI if the build system uses npm ci.

Longer term, I would also recommend logging a warning when there's a config that npm ci cannot honor.

`npm ci` installs the versions recorded in the lockfile. It does **not**
resolve versions or check release dates.

Document that `--before` and `--min-release-age` configs do not affect
`npm ci` in its command reference and generated configuration
references.

Refs: npm#9281
@lreading-turnkey
lreading-turnkey requested review from a team as code owners August 5, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants