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!: error on unknown configs, flags, and abbreviations by owlstronaut · Pull Request #9276 · npm/cli

Conversation

@owlstronaut

@owlstronaut owlstronaut commented Apr 23, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

BREAKING CHANGE: unknown configs in .npmrc, unknown CLI flags, abbreviated flags, and single-hyphen multi-char shorthands now throw instead of warning.

Closes npm/statusboard#1084.

Unknown configs are now hard errors instead of warnings:

  • Unknown keys in .npmrc (project/user/global/builtin), aggregated across files
  • Unknown CLI flags (--bogus)
  • Abbreviated flags (--dry for --dry-run)
  • Single-hyphen multi-char flags (-longflag)

Env (npm_config_*) and publishConfig unknowns still warn.

config, help, doctor, completion, and version opt out via static skipConfigValidation = true so npm config fix and friends keep working when .npmrc is broken.

Notable breaks

  • Legacy top-level auth keys (email, _authToken, _password, username, certfile, keyfile) must be in scoped/nerfdart form. Run npm config fix to migrate.
  • -j no longer expands to --json. Use --json.

Sorry, something went wrong.

Uh oh!

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

All reactions
@owlstronaut
owlstronaut requested a review from a team as a code owner April 23, 2026 20:33
@owlstronaut
owlstronaut force-pushed the feat/error-on-unknown-configs branch 5 times, most recently from a386ace to fd9faf7 Compare April 23, 2026 21:09
@coderabbitai coderabbitai Bot mentioned this pull request May 13, 2026
chore: add npm supply-chain hardening kitze/apple-crusher#1
Merged
nishantms
nishantms reviewed May 18, 2026
View reviewed changes
Comment thread workspaces/config/lib/index.js Resolved

Uh oh!

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

Comment thread lib/base-cmd.js Resolved

Uh oh!

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

Comment thread workspaces/config/lib/index.js Resolved

Uh oh!

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

Comment thread workspaces/config/lib/index.js Resolved

Uh oh!

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

@owlstronaut
owlstronaut force-pushed the feat/error-on-unknown-configs branch from fd9faf7 to 7c21cdf Compare May 20, 2026 15:48
@owlstronaut
owlstronaut requested a review from a team as a code owner May 20, 2026 15:48
@owlstronaut
owlstronaut requested a review from nishantms May 20, 2026 15:53
nishantms
nishantms reviewed May 21, 2026
View reviewed changes
Comment thread lib/base-cmd.js Outdated
'Run `npm help config` for supported options.',
].join('\n')
throw Object.assign(new Error(msg), {
code: 'EUNKNOWNCONFIG',

@nishantms nishantms May 21, 2026

Copy link
Copy Markdown

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.

If a user has both bad cli flags and bad keys in .npmrc, they will only see the cli set, fix those, re-run, then see the file set. Worth combining both lists into a single error so it is one trip?

Sorry, something went wrong.

Uh oh!

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

All reactions
nishantms
nishantms reviewed May 21, 2026
View reviewed changes
Comment thread workspaces/config/lib/index.js
}

// Returns unknown-config entries for a given source ('cli', 'builtin', 'project', 'user', 'global') or all non-env entries when omitted.
getUnknownConfigs (where) {

@nishantms nishantms May 21, 2026

Copy link
Copy Markdown

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.

nit — comment says "all non-env entries when omitted" but the filter also drops publishConfig. Maybe "all entries except env and publishConfig"?

Sorry, something went wrong.

Uh oh!

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

All reactions
nishantms
nishantms reviewed May 21, 2026
View reviewed changes
Comment thread test/lib/base-cmd.js
}

const command = new TestCommand(npm)
t.doesNotThrow(() => command.validateCli(), 'skipConfigValidation bypasses unknown-file-config check')

@nishantms nishantms May 21, 2026

Copy link
Copy Markdown

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.

nit — worth adding a test here that runs a command with NPM_CONFIG_<unknown>=1 set and asserts validateCli does not throw? The carve-out lives in getUnknownConfigs() — a regression test at the base-cmd level would lock it in so the env→warn behavior cannot silently flip if that filter changes.

Sorry, something went wrong.

Uh oh!

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

All reactions
nishantms
nishantms previously approved these changes May 21, 2026
View reviewed changes

@nishantms nishantms left a comment

Copy link
Copy Markdown

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.

LGTM, no major blocker, few nits

Sorry, something went wrong.

Uh oh!

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

All reactions
Michael Smith
feat!: error on unknown configs, flags, and abbreviations
8d584bc
BREAKING CHANGE: unknown configs in .npmrc, unknown CLI flags, abbreviated flags, and single-hyphen multi-char shorthands now throw instead of warning.
@owlstronaut
owlstronaut dismissed nishantms’s stale review via 8d584bc May 21, 2026 18:17
@owlstronaut
owlstronaut force-pushed the feat/error-on-unknown-configs branch from 7c21cdf to 8d584bc Compare May 21, 2026 18:17
nishantms
nishantms approved these changes May 21, 2026
View reviewed changes
@owlstronaut
owlstronaut merged commit 979518d into latest May 21, 2026
33 checks passed

Uh oh!

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

@owlstronaut
owlstronaut deleted the feat/error-on-unknown-configs branch May 21, 2026 18:36
@github-actions github-actions Bot mentioned this pull request May 21, 2026
chore: release 12.0.0-pre.1 #9387
Merged
@cursor cursor Bot mentioned this pull request Jun 2, 2026
ci(cli): add CLI smoke matrix workflow (M7, REQ-4.1 to REQ-4.5) rjmurillo/ai-agents#2232
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Jun 10, 2026
Add supply chain security policy with npm cooldown tjackiet/bitbank-lab-mcp-legacy#630
Merged
@npm-cli-bot npm-cli-bot mentioned this pull request Jun 23, 2026
deps: upgrade npm to 12.0.0-pre.1 nodejs/node#64096
Closed
@reggi reggi mentioned this pull request Jul 7, 2026
feat: warn instead of error on unknown .npmrc configs #9729
Merged
reggi added a commit that referenced this pull request Jul 7, 2026
@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 added a commit that referenced this pull request Jul 8, 2026
@reggi
feat: warn instead of error on unknown .npmrc configs (#9729)
fd75880
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.
@reggi reggi mentioned this pull request Jul 8, 2026
chore: clarify unknown-config breaking change note in changelog #9733
Merged
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]>
@coderabbitai coderabbitai Bot mentioned this pull request Jul 23, 2026
feat: add new security extras for npm, uv, and mise (2026-07-23 scan) HikaruEgashira/pmsec#45
Merged
@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.
@coderabbitai coderabbitai Bot mentioned this pull request Aug 22, 2026
fix(update): recover npm 12 self-updates lidge-jun/opencodex#2383
Merged
7 tasks done
@reggi reggi mentioned this pull request Sep 23, 2026
ci: CITGM relies on native-build option forwarding rejected by npm 12 #10023
Closed
0xDarkMatter added a commit to 0xDarkMatter/claude-mods that referenced this pull request Oct 6, 2026
@0xDarkMatter @claude
fix(skills): Judge pm-audit deploys per GitHub Actions job
4886bee
A read-only run of pm-audit over 88 real agency repositories found
three accuracy problems in package-manager-ops' audit.

deploy.composer.dev was decided per file. A common workflow lints in
one job (composer install without --no-dev) and ships from another
(composer install --no-dev, zip, aws deploy); the lint job was flagged
in all 27 repositories that used the shape, every time wrongly.
GitHub Actions workflows are now split into the children of jobs:
(indent read from the file, 2 and 4 spaces both seen), and only a job
that ships is asked for --no-dev. An aws s3 cp/mv upload now counts as
shipping; a download from S3 does not. GitLab CI and Bitbucket
Pipelines stay whole-file: their later jobs receive every earlier
artifact by default and inherit commands through extends:/anchors.
deploy.install.unfrozen stays in every job on purpose: the managers
document frozen installs for CI as a whole, and a front-end job whose
build the deploy job downloads ships its install.

npm install --frozen-lockfile now gets its own message. The flag is
Yarn's: npm up to 11.1 ignores it, 11.2+ warns and installs unfrozen,
and npm 12 refuses the command (npm/cli#9276).

php.require.missing is a note in a project that sets
config.platform.php. Per Composer 2.10.3 (doc/06-config.md and
AutoloadGenerator::getPlatformCheck), install checks require.php
against the pretended PHP, and platform_check.php already enforces the
highest PHP floor of the root and every installed non-dev package. A
library keeps the warning: config is root-only, so consumers see only
require.php.

Six new fixture cases plus an optional _lines pin in tests/run.sh that
asserts which line fires. Each new check failed against the old code,
and 8 mutants (split off, split hard-coded to 2 spaces, Yarn-flag check
dropped, unfrozen made per-job, three PHP demotion variants, s3 marker
dropped) were each killed by the fixture meant for them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
0xDarkMatter added a commit to 0xDarkMatter/claude-mods that referenced this pull request Oct 6, 2026
@0xDarkMatter @claude
fix(skills): Teach pm-audit the lessons of a real-repo sweep
0fccc00
A sweep of real agency repositories, checked finding by finding against
the files, showed where package-manager-ops' audit misread the repo.

php.lockfile.stale now mirrors Composer's own lock check
(Locker::getMissingRequirementInfo): a locked package's replace or
provide meets a requirement, and a root require is met only from
`packages` (getLockedRepository(false)), so one locked solely in
packages-dev is reported, as Composer refuses it.

CI that builds in a subfolder is placed in that package root: a literal
working-directory (step, or job defaults.run), ${{ env.X }} from the
workflow or job env, GitHub's workspace prefix, and cd within one
command block. Findings name the root; the root's js.lockfile.missing
becomes a note when CI installs only nested roots that have a lockfile;
the new deploy.install.unlocked reports CI installing in a folder with a
manifest but no lockfile. Unknown directories (matrix paths, other
expressions, Dockerfile WORKDIR) are never guessed.

js.lockfile.conflict names the live lockfile when every root CI install
uses one manager. php.eol and js.node.eol say what the repo pins and ask
to confirm the server's version; literal setup-node node-version and
setup-php php-version feed the agreement and end-of-life checks, never
the repo's own unpinned check.

New: deploy.global.unpinned for npm install -g without an exact version
in CI and deploy files (native CLIs stay npx.native-cli), and
deploy.npm.yarn-flag, an error, for --frozen-lockfile/--immutable on
npm ci or npm install. Read from npm's source at each tag: v11.1.0 has
no unknown-config check, v11.2.0 warns "Unknown cli config", v12
validateCli throws EUNKNOWNCONFIG before the command runs (npm/cli#9276).
npm install --frozen-lockfile moves there from deploy.install.unfrozen.

references/diagnostics.md gains "Auditing many repos": a verified
read-only sparse partial-clone recipe, Windows notes, auditing the
branch that deploys, and the shapes to check by hand.

17 new fixture cases (71 in all); every new check failed against the
pre-lane pm-audit (30 checks), and 35 mutants were each killed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cristianchiriac cristianchiriac mentioned this pull request Oct 16, 2026
Fix nodejs.install with npm 12 anomalyco/sst#7031
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@nishantms nishantms nishantms approved these changes

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.

error on unknown flags

Uh oh!

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

2 participants

@owlstronaut @nishantms
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.