Release Process
Overview
- When possible, it is optimal to have both a
latest(stable) version ofnpmalongside thenextversion under thedist-tagofx.y-next, wherexandyare the semver-major and -minor components of that release's version - When issues are found in a
next-xrelease, a new patch release will may be published and retagged asnext-x, to eventually be promoted tolateston the following release date - The release cadence is optimized for consistency – new releases happen every two-to-four weeks, on the same day of the week (Thursday)
- Out-of-band releases can & do happen to address critical security bugs or patch a broken release
- There is only one officially supported release branch:
npm@6(latest) (ie. the latest/stable version of npm)
Note: we're currently shipping weekly releases of
npm@7every Thursday (& sometimes even more than once a week).
Roles
Each release has a release manager, who is responsible for landing that release's pull requests and dependency upgrades, ensuring that the tests pass for the release branch, writing the release notes, and running through the actual release process (see below). The current release managers are the npm CLI team:
- Isaac Schlueter / @isaacs
- Darcy Clarke / @darcyclarke
- Ruy Adorno / @ruyadorno
- "nlf" / @nlf
- "gar" / @wraithgar
- Luke Karrys / @lukekarrys
- Nathan Fritz / @fritzy
If you're a new release manager, start by looking at the release setup notes.
Quick Checklist
-
1. Start a new release branch.
- Run:
git checkout release-next && git pull - Run:
node . run resetdeps
- Run:
-
2. Pull in PRs
- Install the
pullcli:npm i -g @npmcli/pull - Make sure the PR is against
release-nextand notlatest(this will make it close purple instead of red) - Run:
pull <pull # OR url> - Fixes any inconsistencies (such as changing reviewer attribution) then
git commit --amend(if needed) - Run:
pull updatein order to push the release branch and update the target PR with the ammended commit
- Install the
-
3. Update Deps
- Check outdated:
node . outdated&node . outdated -a --omit=dev - Run:
node . install <pkg>@<version> - Run:
node ./scripts/bundle-and-gitignore-deps.js - Run:
git add -A && git commit -m '<pkg>@<version>'
- Check outdated:
-
4. Make sure tests pass ✅
node . tnode . run smoke-tests
-
5. Generate Changelog
- Run:
node ./scripts/changelog.js <commitish>(ex.<commitish>should be a tag or SHA reference to the previous release)- Copy output into
CHANGELOG.md - Manually reformat & match style of historical updates
- Run:
git add CHANGELOG.md && git commit -m 'docs: changelog for v<MAJOR>.<MINOR>.<PATCH>'
- Copy output into
- Run:
-
6. Update Version
- Run:
node . version <exact version number>|major|minor|patch
- Run:
-
7. Push to GitHub
- Run:
git push origin release-next:release/v<MAJOR>.<MINOR>.<PATCH>(creates a release branch in the remote repo). - Make a PR from this branch to
latest, with the body being just the changelog for this version, with every entry on one line. - Ensure PR CI tests pass.
- Run:
-
8. Publish Package
- Run:
make publish
- Run:
-
9. Update Dist Tags
- Run:
node . dist-tag add npm@<version> latest - Run:
node . dist-tag add npm@<version> lts - Run:
node . dist-tag add npm@<version> next
- Run:
- 10. Add release notes - ref: release x.x.x
-
11. Merge the release branch into
latest(this automatically closes the PR) - 12. Post on Twitter w/ ref to GitHub tag/changleog- ref: new post
- 13. Update Node.js
Planning
The team meets weekly to determine what to include in that week's release, and typically covers the following outline:
- How many of the CLI team's in-progress pull requests will be ready to ship this week?
- Are there too many GitHub issues or pull requests assigned to team members?
- Review available dependency upgrades (
npm outdated -lagainst each supported release series. - Review outstanding community pull requests against
npm/cli& label accordingly.- ex. GitHub PR search filter:
is:pr is:open sort:updated-desc -label:"semver:major" -label:Backlog -label:"Needs Tests" -label:"Needs Discussion"
- ex. GitHub PR search filter:
- Review outstanding pull requests against npm dependencies managed by the CLI team & label accordingly.
- Does the team need to release a new
npm@6(LTS) this week? - What's going into this week's release?
- What does the team want to land in next week's release?
- Is there anything marketable in upcoming releases?
- Update release milestones & the road map weekly focus.
Preparing
Create a release/x.y.z branch on which to land all changes before finally releasing it to the respective target branch, so you can rebase / rewrite the branch's commits freely. Be aware that rebasing after you've started work on the release notes will mean you'll have to fix up and check all the commitishes that are on the rebased branch.
All pull requests must be reviewed by a member of the CLI team before being merged into the release branch. The review process is pretty flexible and straightforward, but it must be followed, and if the team decides that a change isn't ready to ship, it'll be punted to the next release. A week isn't too much longer to wait (although in some rare cases, tricky patches have taken up to a few months to be included).
- Dependency upgrades should be landed as commits on the release branch
release-next - Look for outdated dependencies with
npm outdated -l - Each module updated should be done as a single commit with a commit subject of
package@version(runscripts/dep-update <package> <version>to handle this for you)
Cutting the release
Each branch's release manager follows this procedure:
- The release manager ensures that all tests are passing for the release branch (usually
release-nextorrelease-next-<n>). - The release manager updates the changelog with salient changes for that release, calling out any breaking changes. You can get a head start on the changelog by running
scripts/gen-changelog, which will do its machine best to generate a changelog for you and stick it at the top ofCHANGELOG.md. It's not a very smart script though, so you'll still need to edit the result. - The release manager gets a CLI team member to review the release notes for content and style.
- The release manager runs
npm version <version>on the branch. If it's a new patch or minor version, it should beX.Y.Z-next.0. If it's a patch to an existing prerelease, increment the number. The git release tags are always signed with GnuPG by a npm core team member. (More on setting up GPG with Git.) - The release manager runs
make publishon the branch. This:- Ensures that the docs have been built correctly.
- Ensures that all changes and tags have been pushed to the appropriate branch on GitHub.
- Publishes
npmto the registry, setting the release tag tovX.Y-next(notlatest, for reasons described above). - NOTE: make sure you have github and npm write permissions!
- The release manager runs
npm dist-tag set npm@<new-version> nextin order to update thenexttag and repeat the command in order to update the other appropriate tags (or,next-<n>if doing a prerelease for a different major version line) - The release manager cleans up the
vX.Y-nextthat was generated as part of the publish process, usingnpm dist-tag rm npm vX.Y-next. - Post the release notes to Github Releases. Make sure to remove extra newlines from the original, to preserve text flow in browsers.
- The release manager tweets about the new release!
Twitter template
New @npmjs release! DETAILS_ABOUT_THE_RELEASE
latest: X.X.X
next: X.X.X
Submitting to Node.js
- Open the Create CLI Deps PR action: https://github.com/npm/cli/actions/workflows/create-cli-deps-pr.yml
- Click
Run workflow>Run workflowgreen confirmation button
Here's just a ref to the previous, manual way of handling the update
Before starting, make sure that you're working from a clone of Node.js where:- a remote named
downstreampoints athttps://github.com/nodejs/node.git - a remote named
npmpoints atgit@github.com:npm/node.git
- Checkout a new branch for the release:
git checkout -b npm-x.y.z - Run through the steps in the Maintaining npm in Node.js doc.
- Once complete, go to the npm fork of node & create a pull request, ensuring that the base of the PR is
node/master. - In the body of the PR, link to the release notes for that version.
Merge the release
Merge release/x.y.z into latest
git checkout latest
git fetch && git pull
git merge --ff-only origin/release/vx.y.z
git push origin latest --follow-tags

