Skip to content

Fix usage path for subcommand errors#9434

Open
AI-DEV-BOT wants to merge 2 commits into
npm:latestfrom
AI-DEV-BOT:fix/subcommand-usage-path
Open

Fix usage path for subcommand errors#9434
AI-DEV-BOT wants to merge 2 commits into
npm:latestfrom
AI-DEV-BOT:fix/subcommand-usage-path

Conversation

@AI-DEV-BOT
Copy link
Copy Markdown

Summary

  • Preserve the full command path on subcommand instances during execution
  • Use that path when rendering usage errors, so npm stage approve reports npm stage approve <stage-id> instead of npm approve <stage-id>
  • Point subcommand usage errors back to the parent command help page

Fixes #9403

Validation

  • node E:\dev\open-source\npm-cli\node_modules\tap\bin\run.js --no-coverage test\lib\npm.js test\lib\base-cmd.js test\lib\commands\stage\approve.js
  • node E:\dev\open-source\npm-cli\node_modules\eslint\bin\eslint.js lib\base-cmd.js lib\npm.js test\lib\npm.js
  • git diff --check

@AI-DEV-BOT AI-DEV-BOT requested review from a team as code owners May 29, 2026 13:52
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.

[BUG] Subcommand usage errors show the wrong command path (e.g. "npm approve" instead of "npm stage approve")

1 participant