<external_links>
Potentially Relevant Websearch Results
You should respond as if these information are known to you. Refrain from saying "I am unable to browse the internet" or "I don't have access to the internet" or "I'm unable to provide real-time news updates". This is your internet search results. Please always cite any links you referenced from the above search results in your response in markdown format.
Website URL: https://gist.github.com/mcollina/b294a6c39ee700d24073c0e5a4e93104
Website Title: Configuring minimum release age across npm, pnpm, and yarn · GitHub
Website Content:
Skip to content
Search Gists
Search Gists
All gists Back to GitHub Sign in Sign up
Sign in Sign up
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
@mcollina
mcollina/guide.md
CreatedApril 30, 2026 09:41
Show Gist options
Select an option
- Embed Embed this gist in your website.
- Share Copy sharable link for this gist.
- Clone via HTTPS Clone using the web URL.
No results found
Learn more about clone URLs
Clone this repository at <script src="https://gist.github.com/mcollina/b294a6c39ee700d24073c0e5a4e93104.js"></script>
- Save mcollina/b294a6c39ee700d24073c0e5a4e93104 to your computer and use it in GitHub Desktop.
Code Revisions1 Stars86 Forks6
Embed
Select an option
- Embed Embed this gist in your website.
- Share Copy sharable link for this gist.
- Clone via HTTPS Clone using the web URL.
No results found
Learn more about clone URLs
Clone this repository at <script src="https://gist.github.com/mcollina/b294a6c39ee700d24073c0e5a4e93104.js"></script>
Save mcollina/b294a6c39ee700d24073c0e5a4e93104 to your computer and use it in GitHub Desktop.
Download ZIP
Configuring minimum release age across npm, pnpm, and yarn
Raw
guide.md
Configuring minimum release age across npm, pnpm, and yarn
Setting a minimum release age (a "cooldown") on dependencies is a cheap, high-leverage defense against supply-chain attacks. Most malicious package versions are detected and yanked within hours, so a 24-hour delay filters out the smash-and-grab incidents (axios 1.14.1, ua-parser-js, Solana web3.js, etc.).
All three major Node.js package managers now support this, but each one used a different name and a different unit. Here is what you need.
Minimum versions
| Tool | Setting | Unit | Introduced in |
|---|
| npm | min-release-age | days | npm CLI 11.10.0 (Feb 2026) |
| pnpm | minimumReleaseAge | minutes | pnpm 10.16 (Sep 2025); default 1440 since pnpm 11.0 |
| Yarn | npmMinimalAgeGate | minutes (numeric) | Yarn Berry 4.10.0 |
A note on Yarn: the docs advertise duration strings like "7d", but there's a known parsing bug (yarnpkg/berry#6991) where day suffixes were silently ignored. Until that's resolved everywhere, pass minutes as a number. 1 day = 1440.
npm — per-project
Add to .npmrc in the project root:
min-release-age=1
The value is in days. Do not combine with --before in the same invocation — npm errors out if both are present.
npm — locally (user-wide)
npm config set min-release-age 1 --location=user
This writes to ~/.npmrc. Use --location=global if you want it in the global npm config instead.
pnpm — per-project
Put it in pnpm-workspace.yaml (this is the canonical place since pnpm 11; in earlier versions .npmrc also works):
minimumReleaseAge: 1440
Optional, if you have internal packages you want to bypass the gate:
minimumReleaseAge: 1440
minimumReleaseAgeExclude:
If you're still on pnpm 10.x, the .npmrc form is:
minimum-release-age=1440
Heads-up: on pnpm 10.x there's a known bug where minimumReleaseAge is silently ignored if any package in the workspace has shared-workspace-lockfile=false in its .npmrc (pnpm/pnpm#10008). Worth checking.
pnpm — locally (user-wide)
pnpm config set minimumReleaseAge 1440 --location=user
On pnpm 11+, non-auth settings like this go into ~/.config/pnpm/config.yaml rather than ~/.npmrc.
Yarn (Berry 4.10+) — per-project
In .yarnrc.yml:
npmMinimalAgeGate: 1440
If you have packages that must bypass the gate:
npmMinimalAgeGate: 1440
npmPreapprovedPackages:
npmPreapprovedPackages accepts both glob patterns and exact locators (e.g. @aws-sdk/types@3.877.0), which is more flexible than pnpm's package-name-only exclusions.
Yarn — locally (user-wide)
yarn config set --home npmMinimalAgeGate 1440
--home writes to ~/.yarnrc.yml instead of the project-local file.
A few caveats worth knowing
The cooldown is enforced at install time, not at update-suggestion time. If you're using Renovate or Dependabot, configure their minimumReleaseAge / cooldown independently — otherwise they'll keep opening PRs you can't actually install. Renovate 42's config:best-practices preset already sets a 3-day default for npm; Dependabot's cooldown.default-days is the equivalent.
None of these tools currently let you scope the gate per registry, so internal packages from a private registry get held back along with everything else unless you put them in the exclusion list (npm doesn't have one yet — there's an open issue, #8994).
The defaults will likely shift soon: pnpm 11 already turned this on by default at 1440 minutes, and npm CLI v12 is expected to do the same. Setting it explicitly now means your config keeps working unchanged when defaults move.
@smairo
smairo commented May 15, 2026
Copy link Copy Markdown
You should include bun as well: https://bun.com/docs/runtime/bunfig#install-minimumreleaseage
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
@VladSez
VladSez commented May 20, 2026
Copy link Copy Markdown
thanks Matteo!
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
@tom-ricci
tom-ricci commented May 25, 2026
Copy link Copy Markdown
Forked this and added a section for bun users (https://gist.github.com/tom-ricci/bade55606ebb7a550598f11e29f1d6b0)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
@tordans
tordans commented May 30, 2026
Copy link Copy Markdown
Another nice info to add is that npx, bunx do not use those flags, apparently. For bun this is tracked in oven-sh/bun#30748
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
@aaujoingmail
aaujoingmail commented Jun 2, 2026
Copy link Copy Markdown
(NPM)
npm i --min-release-age 0 package@version to install a specific package version that would be otherwise time blocked by the set minimum release age.
E.g. for installing a critical hotfix of a certain package immediately.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
@cyb3rko
cyb3rko commented Jul 2, 2026
Copy link Copy Markdown
Same can be applied to Python packages via pip or uv
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
@tchetwin
tchetwin commented Jul 15, 2026
Copy link Copy Markdown
As of yesterday, Dependabot as well: https://github.blog/changelog/2026-07-14-dependabot-version-updates-introduce-default-package-cooldown/
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sign up for free to join this conversation on GitHub. Already have an account?Sign in to comment
Footer
© 2026 GitHub, Inc.
Footer navigation
- Terms
- Privacy
- Security
- Status
- Community
- Docs
- Contact
- Manage cookies
- Do not share my personal information
You can’t perform that action at this time.
</external_links>
Wednesday, Aug 5, 2026, 10:37 AM (UTC+2)
what can we do to put a delay release age for everything we install in the project (python and ts) like mentionned here https://gist.github.com/mcollina/b294a6c39ee700d24073c0e5a4e93104