Skip to content

Fix .npmrc min-release-age: value is days, not seconds#437

Merged
oxyc merged 1 commit into
masterfrom
fix/npmrc-min-release-age-days
Jun 9, 2026
Merged

Fix .npmrc min-release-age: value is days, not seconds#437
oxyc merged 1 commit into
masterfrom
fix/npmrc-min-release-age-days

Conversation

@oxyc

@oxyc oxyc commented Jun 9, 2026

Copy link
Copy Markdown
Member

min-release-age is interpreted by npm as a number of days, not seconds.

npm's own config flattener (@npmcli/config) computes the cutoff as:

flatOptions.before = new Date(Date.now() - (86400000 * obj['min-release-age']))

86400000 ms = one day, so the value is multiplied by days.

  • 604800 → 604800 days (~1656 years) → cutoff lands in year 370 AD → npm rejects
    every package version (ENOVERSIONS/ETARGET), breaking all installs.
  • 7d → invalid (config type is Number, not a string) → parsed as null → the
    cooldown is silently disabled (no protection at all).
  • 7 → 7 days → correct.

This restores the intended 7-day supply-chain quarantine. Verified against npm
11.14.1: 7 blocks releases <7 days old and allows older ones.

🤖 Generated with Claude Code

@oxyc oxyc merged commit dc45635 into master Jun 9, 2026
@oxyc oxyc deleted the fix/npmrc-min-release-age-days branch June 9, 2026 13:35
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.

1 participant