npx -p @scope/pkg binary fails: RTK treats scoped package name as npm subcommand
#713 ouverte le 18 mars 2026
Métriques du dépôt
- Stars
- (48 085 stars)
- Métriques de merge PR
- (Merge moyen 11j 1h) (45 PRs mergées en 30 j)
Description
Bug
rtk npx does not handle the -p <scoped-package> <binary> form of npx. When the package name starts with @, RTK appears to parse it as a npm subcommand rather than a package specifier.
Reproduction
# Fails
npx -y -p @playwright/cli playwright-cli list
# Error: Unknown command: "@playwright/cli"
# Also fails
npx --package=@playwright/cli playwright-cli list
# Error: Unknown command: "playwright-cli"
# Works (bypasses RTK)
rtk proxy npx --package=@playwright/cli -- playwright-cli list
# Output: ### Browsers\n (no browsers)
Context
- RTK version: 0.29.0
- npm version: 10.9.3
- Node: v22.19.0
- macOS (Apple Silicon)
The rewrite hook converts npx -y -p @playwright/cli playwright-cli list to rtk npx -y -p @playwright/cli playwright-cli list, which then fails. Using rtk proxy npx works correctly.
This affects any skill or tool that invokes CLI tools from scoped npm packages (e.g. @playwright/cli, @anthropic-ai/sdk, etc.) via the standard npx package flag syntax.
Related
Issue #197 covers passthrough of known tools via npx but does not cover the -p @scope/package binary invocation pattern.