Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Running a subcommand without its required argument renders the usage error with the bare subcommand name instead of the full parent path. For example, npm stage approve (with no <stage-id>) prints:
npm error Missing required <stage-id>
npm error
npm error Approve a staged package, publishing it to the npm registry
npm error
npm error Usage:
npm error npm approve <stage-id>
Neither npm approve nor npm help approve exists, so following the message fails. The same applies to other npm stage/npm trust subcommands. npm stage approve --help already renders correctly; only the runtime usage error is wrong.
Expected Behavior
The error should reference the real command and help page:
npm error Usage:
npm error npm stage approve <stage-id>
...
npm error Run "npm help stage" for more info
Steps To Reproduce
- Run
npm stage approve (omit the <stage-id>).
- Observe the EUSAGE usage block.
- It points to
npm approve / npm help approve, neither of which exists.
Environment
- npm: 11.15.0
- Node.js: v26.0.0
- OS Name: MacOS 26.4
- System Model Name: N/A
- npm config:
//registry.npmjs.org/:_authToken = (protected)
ignore-scripts = true
min-release-age = 7
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Running a subcommand without its required argument renders the usage error with the bare subcommand name instead of the full parent path. For example,
npm stage approve(with no<stage-id>) prints:Neither
npm approvenornpm help approveexists, so following the message fails. The same applies to othernpm stage/npm trustsubcommands.npm stage approve --helpalready renders correctly; only the runtime usage error is wrong.Expected Behavior
The error should reference the real command and help page:
Steps To Reproduce
npm stage approve(omit the<stage-id>).npm approve/npm help approve, neither of which exists.Environment