Skip to content

fix(pm): fail on unsupported package manager options - #2775

Draft
jong-kyung wants to merge 29 commits into
voidzero-dev:mainfrom
jong-kyung:fix/unsupported-pm-options-error
Draft

jong-kyung wants to merge 29 commits into
voidzero-dev:mainfrom
jong-kyung:fix/unsupported-pm-options-error

Conversation

@jong-kyung

@jong-kyung jong-kyung commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Vite+ now returns an error when package-manager support checks reject a named option, instead of dropping the option and running a different operation. Detected violations are reported together and remain fatal in silent and
machine-readable modes.

The command audit also corrects dependency selection and workspace update behavior where native equivalents exist. Raw arguments after --, managed-global package operations, and intentional optionless no-ops and fallbacks retain their existing behavior.

Closes #2764

Behavior decisions

  • Reject unsupported options before command construction, pre-run actions, and execution.
  • Reject install-only --fix-lockfile and --resolution-only when adding packages, and add-only --save-exact,
    --save-peer, --save-optional, and --save-catalog without package names. Aggregate these errors with manager-specific restrictions before lowering, including in silent mode.
  • Reject npm and Yarn update dependency selectors and npm/Yarn/Bun removal dependency selectors rather than changing unrelated dependency groups.
  • Map npm production listing to --omit dev, preserving optional and peer exclusions. Reject npm dev-only listing because --include=dev does not restrict the output to dev dependencies.
  • Preserve Yarn Classic interactive updates through upgrade-interactive, but reject recursive updates, multiple workspace filters, and filtered interactive updates.
  • Use Yarn 3+ up --recursive for range-preserving recursive updates, including --no-save. Use project-wide up with --latest, and reject unsupported version/mode combinations. Implicit all-package selection includes scoped dependencies without widening explicit or raw package patterns.
  • Preserve supported JSON output, npm staged-publish workspace selection, and versioned Yarn home-config writes. Keep npm staged-publishing fallback for Yarn before 4.16.0 and for explicit publish targets.
  • Keep publish --no-git-checks pnpm-only and reject unsupported authentication selectors, why filters, output formats, and named options on otherwise successful no-op paths.

Version reference

Release notes establish the feature boundaries below. Source inspection and isolated native probes establish the option mappings, including manifest, lockfile, installed-version, and workspace effects where relevant.

Feature Supported from Release reference
Yarn user config set through --home 2.2.0 Changelog
Yarn config unset --home, range-preserving up --recursive, and native unlink 3.0.0 Changelog
Yarn native staged publishing 4.16.0 Release notes
npm staged publishing 11.15.0 Release notes
npm script approval, including --all 11.16.0 Release notes
pnpm approve-builds --all 10.32.0 Release notes
Bun audit fix, prune, catalog writes, and update selectors/recursion 1.4.0 Official release post

Native probes of npm 10.9.4, 11.16.0, and 12.0.2 showed that --include does not provide exclusive update or list
selection. Yarn 3.6.0 and 4.16.0 probes showed that recursive "*" skips scoped packages, while "**" includes them. CLI regressions check scoped and unscoped installed versions across workspaces while preserving manifest contents.

Retain supported JSON output, dependency filters, workspace selection, and Bun named catalogs before tightening unsupported-option handling.

Related: voidzero-dev#2764
Aggregate fatal support diagnostics before lowering or execution, without hiding errors in silent output. Keep concise messages with spaced version operators and preserve supported forwarding, raw arguments, and managed-global behavior.

Place execution-safety snapshots with the affected npm update, pack, and install fixtures.

Related: voidzero-dev#2764
Map recursive and filter options to npm workspace flags, including npm
fallbacks. Reject explicit non-dot targets with workspace selection because
npm otherwise ignores the requested workspace scope.
Run dialect-specific diagnosis before lowering. Reject explicit Berry formats, Classic list output, and non-table Bun output while preserving defaults, supported translations, raw arguments, and managed-global formats.

Related: voidzero-dev#2764
Use native staged publishing starting with Yarn 4.16.0 and fall back to
npm on earlier versions. Reject unsupported named options before native
Yarn execution while preserving options supported by npm fallbacks.

Related: voidzero-dev#2764
Declare Yarn and Bun before 1.4 as unsupported for the named --fix
option rather than reporting a successful Noop. Preserve native fix
support and raw pass-through arguments.

Related: voidzero-dev#2764
Reject explicit output and pruning options on unsupported package-manager
paths while retaining the existing command-level Noop when no named
options are requested. Preserve Classic list output, Bun 1.4 pruning,
and managed global list formatting.

Related: voidzero-dev#2764
Reject explicit registry selection for whoami, login, and logout, and reject Classic scope selection before executing commands or clearing credentials. Preserve Berry scope, raw selectors, and other package-manager translations.

Related: voidzero-dev#2764
Declare --all unsupported for Yarn, npm before 11.16.0, and pnpm before 10.32.0 so rejection happens before lowering. Replace the separate pnpm version check with the common diagnostic while preserving supported mappings, optionless Noops, positional validation, and raw arguments.

Related: voidzero-dev#2764
Reject Yarn depth and optional filtering, and npm dependency and workspace selectors whose semantics are not implemented. Aggregate diagnostics while preserving supported filters and raw arguments.

Related: voidzero-dev#2764
Preserve Classic home configuration and reject project writes that would modify it. Route Berry user writes through --home, keep merged reads, and leave global behavior and precedence unchanged.

Require Yarn 2.2 for user-scoped set and Yarn 3 for delete. Reject unsupported locations before execution, with concise version diagnostics and file-preservation snapshots.

The official release changelog documents both native support boundaries:

https://github.com/yarnpkg/berry/blob/01586a88806a2bebd7edb28d1bee3581b1fd3762/CHANGELOG.md#220

https://github.com/yarnpkg/berry/blob/01586a88806a2bebd7edb28d1bee3581b1fd3762/CHANGELOG.md#300

Related: voidzero-dev#2764
Reject named recursive unlink before execution on Yarn versions without the native --all command. Classic can misinterpret the package argument, while Yarn 2 can execute an unrelated project script named unlink.

Preserve Yarn 3 and newer translations, raw arguments, and commands without the named option. Cover aliases, the version boundary, and script non-execution through both CLI flavors.

The Yarn 3.0.0 release links to the changelog announcing the new unlink command:
https://github.com/yarnpkg/berry/releases/tag/%40yarnpkg/cli/3.0.0
https://github.com/yarnpkg/berry/blob/01586a88806a2bebd7edb28d1bee3581b1fd3762/CHANGELOG.md#300

Related: voidzero-dev#2764
Declare --no-git-checks unsupported for npm, Yarn, and Bun instead of silently dropping the named option. Preserve pnpm forwarding and raw arguments after --.

Cover rejection and prepack non-execution in each package-manager publish fixture without authentication setup.

Related: voidzero-dev#2764
Reject named recursive and peer-exclusion options instead of silently discarding them. Preserve Berry translations and raw arguments, and cover both CLI flavors.

Related: voidzero-dev#2764
@jong-kyung jong-kyung self-assigned this Sep 21, 2026
@socket-security

socket-security Bot commented Sep 21, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​npm@​11.16.064100889680
Addednpm/​is-number@​6.0.01001009875100

View full report

Forward --dev on Bun 1.4 and newer. Reject it on older versions before an update can change production or optional dependencies, while preserving raw argument passthrough.

Cover the version boundary, aggregated errors, and dev-only updates through both local and global CLI snapshots.
Reject package-less install --dev before npm install or ci runs, and remove the invalid --omit=prod translation. Preserve install -D <package> through the add resolver and leave raw arguments unchanged.

Cover aggregated errors, silent mode, existing file preservation, and dev dependency additions through both CLI flavors.
Reject package-less install --dev before Bun runs instead of silently installing production dependencies. Preserve install -D <package> through the add resolver and leave raw arguments unchanged.

Cover regular and frozen installs, aggregated errors, and dev dependency additions through both CLI flavors.
Reject package-less install --dev before Yarn Classic or Berry runs instead of silently installing all dependencies. Preserve install -D <package> through the add resolver, raw arguments, and pnpm's existing support.

Cover regular and frozen installs, aggregated errors, and dev dependency additions through both CLI flavors.
Reject npm and Yarn selectors that do not limit the updated dependencies. Support Bun production and optional selection from 1.4, excluding optional dependencies for production-only updates.

Report Yarn Berry filter restrictions with the other unsupported options before lowering. Preserve raw arguments and existing pnpm behavior.
Reject save-dev, save-optional, and save-prod for npm, Yarn, and Bun before they remove packages from unintended dependency sections. Preserve pnpm selectors, raw arguments, and unqualified removals.

Cover aggregated errors and unchanged manifests through both CLI flavors, including workspace removals.
Preserve Yarn Berry's range-aware recursive updates and no-save mode from Yarn 3, and use project-wide up for recursive latest updates. Reject incompatible interactive and version combinations before execution while preserving native raw arguments.

Route Yarn Classic interactive updates through upgrade-interactive, reject unsupported workspace selections, and require Bun 1.4 for recursive updates.

Cover workspace manifests, installed versions, lockfiles, and native interactive selection through both CLI flavors.
Reject Classic filtering and recursive removal, and reject Bun recursive
removal regardless of filters or version. Use option declarations so
unsupported-option errors aggregate before execution.

Preserve native Bun 1.4 filtering without translating recursive removal
into a filter-based workaround.

Cover rejection without mutation, filtered removal from child directories,
raw passthrough, and global routing before local manager validation.
Use npm's omit=dev option for production listings. Including prod and peer
dependencies neither excludes dev dependencies nor respects exclude-peers.

Reject dev-only listings because npm's include=dev does not restrict the
output to development dependencies. Keep native flags available through
raw passthrough and cover production exclusions and aggregated errors.
Declare Classic filter restrictions alongside the other unsupported add
options so a filter error is not hidden by earlier validation failures.
Remove the redundant resolver guard while preserving Berry filtering.

Cover raw arguments and install-with-package dispatch to add validation.
Use a globstar for implicit range-preserving recursive selection so scoped
packages are updated alongside unscoped dependencies. Preserve the latest
mode wildcard, explicit package selection, and raw arguments.

Extend workspace regressions to verify scoped versions and unchanged
manifests through both CLI surfaces.
Move inline version gates into named dialect support methods and reuse the existing npm 12 helper. Preserve version boundaries, unknown npm behavior, and declarative option restrictions.
…options-error

# Conflicts:
#	crates/vp_pm_cli/src/resolution/commands/add.rs
Aggregate install-mode and package-manager support errors before command
lowering instead of warning and continuing after dropping mode-only options.
Preserve supported install-to-add forwarding and raw pass-through arguments.

Cover combined errors, early rejection, and unchanged project state through
unit tests and local/global CLI snapshots, including silent mode.
Refresh the Yarn Classic workspace rejection snapshot for aggregated support
errors. Keep the background upgrade notice checks reachable after a silent
unsupported add fails, and verify a supported silent add still succeeds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skip package-manager operations when a requested option is unsupported

1 participant