Skip to content

fix: support Windows command shims when spawning package managers - #8

Open
LittleSound wants to merge 1 commit into
mainfrom
fix/windows-spawn-enoent
Open

LittleSound wants to merge 1 commit into
mainfrom
fix/windows-spawn-enoent

Conversation

@LittleSound

Copy link
Copy Markdown
Owner

Summary

  • Providers spawned pnpm/npm/yarn/bun/vlt via execFileSync without a shell, so Windows .cmd/.ps1 shims failed with spawnSync pnpm ENOENT.
  • Add src/exec.ts runCommand() built on cross-spawn.sync (no shell: true, args are escaped), keeping execFileSync failure semantics (status on non-zero exit).
  • All five providers now use runCommand.

Closes #7

Testing

  • New tests/exec.test.ts (failed before the fix, passes after)
  • pnpm vitest run — 239/239 ✓, pnpm run lint, pnpm run typecheck, pnpm run build ✓
  • Not yet verified on a real Windows machine.

Package managers such as pnpm, npm and yarn are installed as .cmd shims on Windows, which node:child_process cannot resolve without a shell, causing 'spawnSync pnpm ENOENT'. Route all provider spawns through a runCommand helper backed by cross-spawn, which resolves shims and escapes arguments without enabling shell: true.

Closes #7
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.

win 运行报错

1 participant