docs: add instructions to upgrade npm - #2579
Open
MikeMcC399 wants to merge 2 commits into
Open
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
Author
MikeMcC399
marked this pull request as ready for review
July 26, 2026 13:47
Contributor
Author
|
Could we get this reviewed and landed? This is an FAQ, and an example of where it's relevant is currently: CVE-2026-59873The security release Node.js 22.23.2 contains a critical vulnerability CVE-2026-59873 in tar@7.5.11, bundled in npm@10.9.8, bundled in Node.js 22.23.2 I already reported this through npm/cli#9801 and they have released npm@10.9.9 on 2026-07-28. I haven't seen a PR from npm to Node.js yet for npm@10.9.9 and in any case releasing has built-in delays. It would be good to be able to point users to the information about how to update npm, if they urgently want to remediate the vulnerability. That is what this PR provides. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add instructions to docs/BestPractices on how to upgrade the version of npm from the one packaged with Node.js.
Motivation and Context
npm is bundled with Node.js as described in the Node.js Distribution Policy document.
Although new
semver-minornpm releases flow into their related new Node.js releases as a matter of course, factors such as release cadence and stability policies, mean that npm releases regularly experience a delay before they appear packaged in Node.js. This can pose a problem for users urgently needing npm fixes.The Node.js backporting policy specifies a minimum of 2 weeks' availability in the current release line before a commit is backported to the Active LTS release line. Current releases have a cadence of 2 weeks, Active LTS is based on a 4 week cadence (see release plans in https://github.com/nodejs/Release/issues). This adds up to 8 weeks settling-in time.
Whether npm
semver-majorupdates are backported to existing Node.js release lines, is subject to decision making.The latest major version of npm is 12.x and this is the subject of an open request under nodejs/Release#1161. Node.js currently bundles npm as shown below.
npm 12.x blocks unapproved lifecycle scripts by default - see npm install-scripts. Users may want to have access to this functionality before it is deployed packaged with Node.js
Adding instructions to the documentation assists
nodeDocker users to take advantage of newer npm releases that may include bug fixes, vulnerability remediations or new features. If a bundled version of npm causes compatibility issues for a user, they can also use the same method to downgrade npm to a lower compatible version.Testing Details
Testing logs
Types of changes
Checklist