fix(cli): resolve Windows npx shims for skills#1626
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npxinvocationscmd.exe /d /s /c npx.cmd ...on Windows, while Linux and macOS keep directnpx ...hyperframes skillsand the siblinghyperframes previewnpx vitespawn through the helperRoot cause
Windows npm exposes
npxas annpx.cmdshim. The CLI used barenpxthroughchild_process.execFileSyncandspawn, so Node could fail to resolve/execute the shim even thoughnpx --versionworked in the user's shell. The fix invokes the Windows shim throughcmd.exeexplicitly instead of relying on PATHEXT lookup orshell: true.Fixes #1625.
Test plan
bunx oxfmt --check .github/workflows/ci.yml packages/cli/src/commands/skills.ts packages/cli/src/commands/skills.test.ts packages/cli/src/commands/preview.ts packages/cli/src/utils/npxCommand.ts packages/cli/src/utils/npxCommand.test.tsbunx oxlint packages/cli/src/commands/skills.ts packages/cli/src/commands/skills.test.ts packages/cli/src/commands/preview.ts packages/cli/src/utils/npxCommand.ts packages/cli/src/utils/npxCommand.test.tsbun run --cwd packages/cli typecheckbun run --cwd packages/cli buildvolta run --node 22.20.0 bun run --cwd packages/cli test src/commands/skills.test.ts src/utils/npxCommand.test.tsvolta run --node 22.20.0 bun run --cwd packages/cli test