Skip to content

Productivity · Analysis

npm Staged Publishing: Batch Approval Isn't Atomic

npm now approves up to 100 staged package versions with one 2FA challenge, but a failed version does not roll back the rest. Here is a monorepo release flow that keeps latest safe.

Owen Prestwick · Dec 1, 2026 · 8 min read

Share

GitHub changelog graphic reading npm batch approval releases for staged packages
GitHub, npm batch approval releases for staged packages (GitHub Changelog), 30 Nov 2026. Source: https://github.blog/changelog/2026-11-30-npm-batch-approval-releases-for-staged-packages
On this page

npm now lets a maintainer approve a whole set of staged package versions with one two-factor (2FA) challenge instead of one per version (GitHub changelog, 30 Nov 2026). For a monorepo, that turns a 40-prompt release into one. But npm's own documentation says the versions in a batch are processed independently, and the ones that succeed are not rolled back if another fails.

So one approval is not one atomic release. If your packages depend on each other, you still need a plan for a half-finished set. This piece covers what shipped, why the timing matters (npm is targeting January 2027 for bypass-2FA tokens to lose direct publish), and a release flow that keeps users on latest away from a partial release.

Everything below comes from the npm documentation and GitHub changelog posts, checked on 1 Dec 2026. Metarix did not run a release against the registry.

What changed on 30 November

Staged publishing on npm is not new. Instead of npm publish, a workflow runs npm stage publish, which uploads the version to a holding area. Nothing is installable until a maintainer approves it with 2FA, on the command line or on npmjs.com (npm docs: staged publishing).

Until now, every approval was its own 2FA challenge. The new batch flow on npmjs.com works like this:

  • Open Staged Packages in your account settings, check names, versions, dist-tags, publishers and SHASUMs, and click Add to batch on each version.
  • A batch holds up to 100 package versions, and only one version per package.
  • Approve stays disabled until npm's automated validation of every selected version finishes. You may need to refresh the page.
  • Click Approve (N), check the list in the confirmation dialog, then pass one 2FA challenge for the lot. Reject (N) works the same way.

Two limits are easy to miss. Batching is web only: the CLI's npm stage approve <stage-id> still takes one stage ID at a time (npm-stage CLI reference). And the docs say batch actions are "rolling out gradually", so the tab may not show batching on your account yet.

The changelog calls the feature Staged Publishing Plans and says one approval is bound to the exact packages and versions shown when you approve. It also says npm sees this as a step toward making staged publishing a workable fallback for monorepo publishers who rely on bypass-2FA tokens.

Why one approval is not one release

The changelog pitch is about a real failure mode. With one approval per version, a 30-package release went live piece by piece, so for a while some packages were published while the siblings they depend on were not. Anyone installing in that window could get a broken tree.

A single batch shrinks that window. It does not close it. The staged publishing docs are explicit: batch actions are independent, if one version fails the others can still succeed, and successful actions are not rolled back. The progress dialog shows each version as Waiting, Processing, Succeeded or Failed, and npm tells you to keep the page open while it runs (npm docs).

The announcement talks about a single release; the docs describe independent actions. Plan for the docs. If @acme/[email protected] fails and @acme/[email protected], which needs it, succeeds, users who run npm install @acme/cli get a CLI pointing at a core version that is not on the registry.

There is a second trap in the tag rules. The dist-tag is fixed when you stage. Staging with no --tag means latest, and to change it you must reject the staged version and stage it again (npm-stage CLI reference). So the tag decision belongs in CI, before anyone looks at the batch.

A release flow that survives a failed version

The fix is to keep latest untouched until the whole set is live. Stage under a holding tag, approve once, check, and only then move latest.

Five-step npm monorepo release flow: stage under next, review, batch approve with one 2FA, smoke-test, then move latest, with the npm token timeline from July 2026 to January 2027
The five-step flow, with what happens when a version fails, and the npm token timeline. Metarix editorial diagram built from npm documentation and GitHub changelog posts checked 1 Dec 2026.
  1. Stage every package under `next`. The npm-stage reference notes the command is unaware of workspaces, so loop over package folders and run npm stage publish --tag next in each. Try --dry-run first.
  2. Review on npmjs.com. Compare the SHASUMs with your CI build output. Wait until validation finishes for every version.
  3. Approve the batch. One maintainer, one 2FA challenge. Keep the page open until each row reads Succeeded or Failed.
  4. Check, then smoke-test. If any row failed, retry that version on its own before going on. Then install the @next versions in a clean project and run your tests.
  5. Move `latest`. Run npm dist-tag add <pkg>@<version> latest for each package. With trusted publishing this can run in CI, as long as the publisher has Allow npm dist-tag switched on (npm CLI 11.21.0+ or 12.2.0+).

The price is one extra CI job, which a workflow_dispatch trigger handles well. Two documentation pages disagree on step 5: the npm-stage reference says short-lived trusted publishing tokens can only run npm stage publish and npm publish, while the trusted publishing docs describe dist-tag access with the version numbers above. The trusted publishing page is the more specific one, but test it on one package before you depend on it.

Some sizing math for the batch limits:

Scroll the table horizontally on smaller screens.

2FA challenges per release, staged publishing, before and after batch approval (Metarix arithmetic from npm's documented limits, 1 Dec 2026)
ReleaseOne approval per versionWith batch approvalWhy
12 packages, one version each121Fits one batch
40 packages, one version each401Fits one batch
140 packages, one version each1402Batch cap is 100 versions
40 packages plus a 2.x backport of 10 of them502Only one version per package per batch
Limits from the npm staged publishing documentation, checked 1 Dec 2026. Counts assume every version is approved on npmjs.com; CLI approvals are still one per stage ID.

Who needs to act before January 2027

Batch approval matters most because of a deadline. npm announced on 8 July 2026 that granular access tokens set to bypass 2FA would lose direct publishing (GitHub changelog). On 31 July those tokens lost account, access and trusted-publishing changes, and npm said it is targeting January 2027 for the publishing change (GitHub changelog). After that, a bypass token can read private packages and stage a release, nothing more.

Scroll the table horizontally on smaller screens.

npm publishing paths and the January 2027 change (npm documentation and GitHub changelog, checked 1 Dec 2026)
Publishing pathHuman 2FA per releaseAfter the January 2027 targetNotes
Bypass-2FA granular token + npm publishNoneCan only stageThe path most monorepo CI uses today
Stage-only granular token + npm stage publishOne per batch on npmjs.comNo changeWorks from self-hosted runners; added 18 Sep 2026
Trusted publishing (OIDC) + npm publishNoneNo changeGitHub-hosted runners, GitLab.com shared runners, CircleCI cloud; npm CLI 11.5.1+
Trusted publishing (OIDC) + npm stage publish onlyOne per batch on npmjs.comNo changeThe setup npm's CLI docs recommend
Manual npm publish from a laptopOne per packageNo changeSlow for monorepos
Sources: GitHub changelog posts of 8 Jul, 31 Jul, 18 Sep and 30 Nov 2026, the npm-stage CLI reference and the trusted publishing docs. January 2027 is npm's stated target, not a fixed date.

Who has to do something:

  • Monorepo teams on bypass tokens. You are the main audience. Pick trusted publishing if your runners are hosted by GitHub, GitLab.com or CircleCI. On self-hosted runners, create a token with Read and write (stage only) and switch to npm stage publish (GitHub changelog, 18 Sep). A maintainer with 2FA now has a release-day job, and batching keeps it to one prompt.
  • Single-package maintainers on trusted publishing. Nothing breaks. Batch approval adds little for you. If you want a human check before release, turn off direct publish on the trusted publisher and keep stage only.
  • Org admins. Count who holds 2FA and publish rights on each package. A batch needs one of them to be available on release day.
  • New packages. Since 2 Oct 2026, npm stage publish can create a package from CI, so you no longer need a manual first publish (GitHub changelog). The placeholder 0.0.0-stage version is public, though; pick the name with that in mind.

One security note: a stage-only token is still a write token. It can move dist-tags and deprecate versions, so store it like any publish credential. Our guide on keeping coding agents away from secrets covers where these tokens tend to leak, and Gitleaks vs TruffleHog compares scanners that catch them. If you use OIDC, note that npm now expires a new trusted publisher that has not published within 48 hours (GitHub changelog).

The pattern is the same one GitHub has been pushing on its own platform: short-lived identity in CI, humans only where a decision is needed. Our piece on GitHub Apps replacing enterprise PATs covers the GitHub side.

Our take

If your CI publishes a monorepo with a bypass-2FA token, start the move this month, not in January. Batch approval makes staged publishing workable for a big release, but treat it as one 2FA prompt, not a transaction.

This week, do three things. Check whether batching shows up in your Staged Packages tab. Change your CI to stage with --tag next. And add a small job that moves latest only after every version reads Succeeded and a clean install passes. If any row fails, you fix one package while your latest users never notice.

Sources

Tools covered in this article

Frequently asked questions

Can I batch-approve staged npm packages from the command line?
Not according to the npm docs checked on 1 Dec 2026. Batch approval is on npmjs.com in the Staged Packages tab. The CLI command npm stage approve takes one stage ID and one 2FA challenge at a time.
Does a batch approval roll back if one package fails?
No. npm's staged publishing docs say batch actions are independent: other versions can still succeed when one fails, and successful actions are not rolled back. Retry the failed version on its own.
Can I change the dist-tag of a staged version?
No. The tag is fixed when you run npm stage publish, and it defaults to latest. To change it, reject the staged version and stage it again with the tag you want.
What do I need to use staged publishing?
Publish access to the package, 2FA on your npm account, npm CLI 11.15.0 or later, and Node.js 22.14.0 or later. Staging itself needs no 2FA; approving does.

Follow Metarix

Digital media intelligence hub

AI SaaS · developer workflows · architecture

Share

Related on Metarix