Skip to content

fix(npx): use npx (not npm) for unrecognized npx commands#762

Closed
lineardevon wants to merge 1 commit intortk-ai:developfrom
lineardevon:fix/npx-passthrough-713
Closed

fix(npx): use npx (not npm) for unrecognized npx commands#762
lineardevon wants to merge 1 commit intortk-ai:developfrom
lineardevon:fix/npx-passthrough-713

Conversation

@lineardevon
Copy link
Copy Markdown

Summary

  • The Commands::Npx catch-all fallback called npm_cmd::run(), which invoked npm instead of npx
  • When npx flags preceded the tool name (e.g. npx -y -p @playwright/cli playwright-cli list), routing fell to the catch-all and ran the wrong binary
  • Replace with direct npx passthrough matching the existing prisma passthrough pattern

Fixes #713

Test plan

  • cargo fmt --all && cargo clippy --all-targets && cargo test (1056 passed on develop)
  • Manual testing: verified rtk npx tsc --version and rtk npx playwright test still route to specialized handlers
  • Verified existing passthrough pattern consistency (prisma at lines 1933-1946)

Note: Flag-aware routing (npx -y tsctsc_cmd) and rewrite-layer regex updates are follow-up opportunities.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 21, 2026

CLA assistant check
All committers have signed the CLA.

@aeppling
Copy link
Copy Markdown
Contributor

Hey

We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes src/ from a flat layout into subfolders.

No logic changes — only file moves and import path updates.

What you need to do

Rebase your branch on develop when receiving this comment:

git fetch origin && git rebase origin/develop

Git detects renames automatically. If you get import conflicts, update the paths:

use crate::git;        // now: use crate::cmds::git::git;
use crate::tracking;   // now: use crate::core::tracking;
use crate::config;     // now: use crate::core::config;
use crate::init;       // now: use crate::hooks::init;
use crate::gain;       // now: use crate::analytics::gain;

Need help rebasing? Tag @aeppling

The Npx handler's catch-all fallback called npm_cmd::run(), which
invoked `npm` instead of `npx`. When npx flags preceded the tool
name (e.g. `npx -y -p @playwright/cli playwright-cli list`),
args[0] was a flag, not a tool name, so routing fell to the
catch-all — which then ran the wrong binary entirely.

Replace with direct npx passthrough matching the existing prisma
passthrough pattern. Preserves SKIP_ENV_VALIDATION, tracking, and
exit code propagation.

Fixes rtk-ai#713

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Devon Freitas <devon.freitas@gmail.com>
@KuSh
Copy link
Copy Markdown
Collaborator

KuSh commented Apr 26, 2026

Closing as #1458 has taken care of the problem

@KuSh KuSh closed this Apr 26, 2026
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.

5 participants