npm / npm/cli

[BUG] False positives on new npm 11.x options

Open
#9,710 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Current behavior

New options, introduced during the lifetime of npm 11.x, cause false positive errors when used on earlier versions of npm 11.x - for instance min-release-age-exclude introduced in npm@11.17.0 but not yet bundled into a Node.js 24 Active LTS release.

Applying this setting to .npmrc and then running under Node.js 24.18.0 with bundled npm 11.16.0 results in:

npm warn Unknown project config "min-release-age-exclude". This will stop working in the next major version of npm. See npm help npmrc for supported config options.

Clearly the following statement is untrue and misleading:

"This will stop working in the next major version of npm. See npm help npmrc for supported config options."

This is a barrier to adding options that could be used across different versions of npm. When npm packages specify an engines field for node in their package.json, they are also implicitly specifying a range of packaged npm versions that are supported. That shouldn't cause incorrect warnings to be output.

Secondly, the documentation https://docs.npmjs.com/cli/v11/using-npm/config#min-release-age-exclude does not mention that this option requires a minimum of npm 11.17.0. It shouldn't really require researching npm releases to find this out. The CHANGELOG.md also appears to have gaps in it and jumps from 11.12.1 to 12.00-pre.0.0.0.

Desired behavior

  1. Stop stating that new options "... will stop working in the next major version of npm", when that is not the plan.
  2. Add information to config documentation that makes it clear what the minimum version is for a particular option if it was introduced during the lifetime of the npm major version.

Related

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the npm config documentation for min-release-age-exclude, the npm 11.17.0 release reference, and the related issue 9699. Done means the misleading warning is corrected and the config documentation identifies the minimum npm version for options introduced within an npm major release.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.