GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: warn instead of error on unknown .npmrc configs by reggi · Pull Request #9729 · npm/cli

Conversation

@reggi

@reggi reggi commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What / Why

Unknown configuration keys in .npmrc files now emit a warning by default, restoring pre-npm-12 behavior, instead of throwing. This reverts the file-config portion of the breaking change from 979518d (#9276).

Details

  • Unknown .npmrc (file) configs → warn by default, with the pre-npm-12 wording ("This will stop working in the next major version of npm…").
  • New strict-npmrc config (Boolean, default false) → opts back into treating unknown file configs as a hard EUNKNOWNCONFIG error.
  • Unknown CLI flags and abbreviations → continue to error regardless of this setting.
  • The warning flows through npm's normal display pipeline, so it respects loglevel suppression (e.g. --loglevel=error, --silent).

Tests

  • Updated the file-config validation tests to assert warn-by-default and strict-mode error behavior.
  • Added coverage for combined cli+file unknowns under strict-npmrc, cli-only errors, and loglevel suppression.
  • Regenerated docs.js and config.js snapshots for the new config option.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@reggi
reggi requested review from a team as code owners July 7, 2026 22:18
@reggi
feat: warn instead of error on unknown .npmrc configs
618679d
Unknown configuration keys in .npmrc files now emit a warning by
default, restoring pre-npm-12 behavior, instead of throwing. This
reverts the breaking change from 979518d (#9276) for file-based
configs. The new `strict-npmrc` config (default false) opts back into
treating them as a hard error. Unknown CLI flags and abbreviations
continue to error regardless of this setting.

The warning flows through the normal display pipeline, so it respects
loglevel suppression (e.g. --loglevel=error, --silent).

Co-authored-by: Copilot <[email protected]>
@reggi
reggi force-pushed the reggi/undo-npmrc-error branch from 408cc0d to 618679d Compare July 7, 2026 22:23
nishantms
nishantms approved these changes Jul 7, 2026
View reviewed changes
ljharb
ljharb reviewed Jul 8, 2026
View reviewed changes
Comment thread lib/base-cmd.js
Comment on lines +395 to +396
`Unknown ${u.where} config ${display}. This will stop working in the ` +
'next major version of npm. See `npm help npmrc` for supported config options.')

@ljharb ljharb Jul 8, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd suggest wording this differently, since i suspect making this behavior default will forever be too breaking to ever successfully ship.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@reggi reggi Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but i'm gonna keep this as it was before the major.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ljharb ljharb Jul 8, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough :-) either way super grateful yall are reverting this one for 12.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

saquibkhan and styfle reacted with heart emoji
All reactions
  • ❤️ 2 reactions
martinrrm
martinrrm approved these changes Jul 8, 2026
View reviewed changes
v-kchindam-infy
v-kchindam-infy approved these changes Jul 8, 2026
View reviewed changes
@reggi reggi mentioned this pull request Jul 8, 2026
Revert policy on unrecognized keys in .npmrc #9699
Closed
@reggi
reggi merged commit fd75880 into latest Jul 8, 2026
45 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@reggi
reggi deleted the reggi/undo-npmrc-error branch July 8, 2026 17:23
@github-actions github-actions Bot mentioned this pull request Jul 8, 2026
chore: release 12.0.0-pre.3 #9700
Merged
@reggi reggi mentioned this pull request Jul 8, 2026
chore: clarify unknown-config breaking change note in changelog #9733
Merged
@JamieMagee JamieMagee mentioned this pull request Jul 8, 2026
Plans for npm 12 nodejs/Release#1161
Closed
reggi added a commit that referenced this pull request Jul 8, 2026
@reggi
chore: clarify unknown-config breaking change note in changelog (#9733)
6fefd0e
## What / Why

#9729 reverts the `.npmrc` file-config half of the breaking change from
`979518d` (#9276): unknown `.npmrc` configs warn by default again, and
the new `strict-npmrc` config opts back into erroring. Unknown CLI flags
and abbreviations still throw.

The `12.0.0-pre.1` changelog entry still carried the original wording,
which claimed unknown `.npmrc` configs now throw. Since release-please
aggregates every prerelease `BREAKING CHANGE` note into the eventual
stable `v12.0.0` release notes, that stale line would surface
(inaccurately) in the 12.0.0 notes. This corrects the wording in place.

## Change

Edits the single breaking-changes bullet in the `## [12.0.0-pre.1]`
section:

> unknown CLI flags, abbreviated flags, and single-hyphen multi-char
shorthands now throw instead of warning. (Unknown `.npmrc` configs still
warn by default; opt into erroring with the new `strict-npmrc` config.)

## Notes

- Manual, targeted edit to an already-released, release-please-generated
section — this does not disturb release-please, which derives versions
from git tags + commit history and only prepends new sections.
Precedent: #8298 (`chore: add contributor to changelog entry`).
- Best merged alongside / after #9729 so the corrected note reflects
shipped behavior.

Co-authored-by: Copilot <[email protected]>

Co-authored-by: Copilot <[email protected]>
@MikeMcC399 MikeMcC399 mentioned this pull request Jul 25, 2026
[DOCS] Unknown configs throw error in [email protected] release notes #9802
Closed
@SayantanCode SayantanCode mentioned this pull request Jul 26, 2026
Pin release.yml's npm to 11.18.0, avoiding a real pnpm/npm 12 incompatibility SayantanCode/vayo#35
Merged
2 of 4 tasks
SayantanCode added a commit to SayantanCode/vayo that referenced this pull request Jul 26, 2026
@SayantanCode
Pin release.yml's npm to 11.18.0, avoiding a real pnpm/npm 12 incompa…
565d72c
…tibility (#35)

The first real automated publish attempt (0.1.1-beta.2, all 9 packages)
failed identically for every package: EUNKNOWNCONFIG "Unknown cli flag:
--git-checks". Root cause confirmed via pnpm/pnpm#9646 and npm/cli#9276:
changeset publish always runs pnpm publish --no-git-checks for a pnpm
workspace, and pnpm has an open bug that mangles --no-git-checks into a
bare --git-checks before forwarding it to the underlying npm call. npm
<12 only warned about this; npm 12's breaking change (npm/cli#9276) made
unknown CLI flags a hard error, and the later walkback (npm/cli#9729)
explicitly excludes CLI flags from the softened behavior - so npm 12 will
always hard-fail here regardless of patch version. `npm install -g
npm@latest` was pulling in 12.0.1. Pinned to 11.18.0 instead - the newest
11.x release, well past the >=11.5.1 OIDC requirement, but before the
breaking change.

Nothing was actually published by the failed attempt (confirmed: all 9
packages failed identically before any registry write), so this is a
clean retry, not a partial-state cleanup.
@Hashim1999164 Hashim1999164 mentioned this pull request Jul 26, 2026
docs: clarify npm 12 unknown-config breaking change in changelogs #9805
Merged
reggi pushed a commit that referenced this pull request Jul 27, 2026
@Hashim1999164
docs: clarify npm 12 unknown-config breaking change in changelogs (#9805
9e17dc0
)

## Summary

Fixes #9802.

Before the npm 12 stable cut, #9729 restored warn-by-default for unknown
`.npmrc` keys (with `strict-npmrc` to opt into errors). #9733 updated
the `12.0.0-pre.1` changelog bullet to match, but the aggregated stable
`12.0.0` / `@npmcli/[email protected]` breaking-change notes (and the config
package's `pre.1` note) still said unknown `.npmrc` configs throw.

That stale line also shipped in the published [v12.0.0 GitHub release
notes](https://github.com/npm/cli/releases/tag/v12.0.0).

This aligns those changelog bullets with the corrected wording:

> unknown CLI flags, abbreviated flags, and single-hyphen multi-char
shorthands now throw instead of warning. (Unknown `.npmrc` configs still
warn by default; opt into erroring with the new `strict-npmrc` config.)

Maintainers may also want to refresh the published `v12.0.0` release
body to match; that cannot be updated via this PR alone.

## References

- #9729 (warn instead of error on unknown `.npmrc` configs)
- #9733 (clarified the `pre.1` changelog note)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@martinrrm martinrrm martinrrm approved these changes
@nishantms nishantms nishantms approved these changes
+2 more reviewers
@ljharb ljharb ljharb left review comments
@v-kchindam-infy v-kchindam-infy v-kchindam-infy approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@reggi @ljharb @martinrrm @nishantms @v-kchindam-infy
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.