Skip to content

fix(npx): route unknown packages directly via npx, not npm run#1293

Closed
NEOFIT-dev wants to merge 1 commit intortk-ai:developfrom
NEOFIT-dev:fix/npx-run-injection-unknown-packages
Closed

fix(npx): route unknown packages directly via npx, not npm run#1293
NEOFIT-dev wants to merge 1 commit intortk-ai:developfrom
NEOFIT-dev:fix/npx-run-injection-unknown-packages

Conversation

@NEOFIT-dev
Copy link
Copy Markdown

Problem

rtk npx vue-tsc --noEmit was calling npm run vue-tsc --noEmit instead of npx vue-tsc --noEmit, producing npm error Missing script: "vue-tsc".

Root cause: the default Commands::Npx handler called npm_cmd::run() which injects run before any argument not found in NPM_SUBCOMMANDS. Since vue-tsc is not in that list, it became npm run vue-tsc.

Note: rtk npx vue-tsc --version appeared to work by accident — npm silently consumes --version as its own flag rather than passing it to the script.

Fix

Add npm_cmd::run_npx() that calls npx <args> directly without any run injection, and use it as the default handler for unknown packages in Commands::Npx.

Testing

# Before (system rtk 0.35.0)
$ rtk npx vue-tsc --noEmit
npm error Missing script: "vue-tsc"

# After
$ rtk npx vue-tsc --noEmit
Version 6.0.2
tsc: The TypeScript Compiler - Version 6.0.2
...

Fixes #1269

Unknown npx packages like vue-tsc were routed to npm_cmd::run which
injects "run" before unrecognised first arguments, turning
`rtk npx vue-tsc --noEmit` into `npm run vue-tsc --noEmit`.

Add run_npx() that calls `npx <args>` directly and use it as the
default handler in Commands::Npx.

Fixes rtk-ai#1269
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 14, 2026

CLA assistant check
All committers have signed the CLA.

@KuSh
Copy link
Copy Markdown
Collaborator

KuSh commented Apr 26, 2026

Closing as #1458 already fixed 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.

3 participants