Skip to content

fix(dev): use shell on Windows to avoid EINVAL when spawning tsx.cmd#558

Open
MicroGery wants to merge 2 commits into
MoonshotAI:mainfrom
MicroGery:fix/dev-windows-spawn
Open

fix(dev): use shell on Windows to avoid EINVAL when spawning tsx.cmd#558
MicroGery wants to merge 2 commits into
MoonshotAI:mainfrom
MicroGery:fix/dev-windows-spawn

Conversation

@MicroGery

Copy link
Copy Markdown
Contributor

Resolve #549

Problem

On Windows with Node.js v24, pnpm dev:cli fails to start. The dev launcher (apps/kimi-code/scripts/dev.mjs) spawns the tsx binary, which on Windows resolves to tsx.cmd. Node v24 refuses to spawn .cmd files without shell: true and throws EINVAL, so the dev CLI never launches.

What changed

Pass shell: process.platform === 'win32' to the spawn() call. Shell mode is enabled only on Windows, leaving macOS / Linux behaviour unchanged (no extra shell layer, no command-injection surface on those platforms).

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Node.js v24 requires shell: true on Windows to spawn .cmd executables.
Without it, spawn throws EINVAL and the dev CLI cannot start.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f2fc421

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 8, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@f2fc421
npx https://pkg.pr.new/@moonshot-ai/kimi-code@f2fc421

commit: f2fc421

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a3ac04138

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-code/scripts/dev.mjs
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.

node-sdk build failed in windows 11

1 participant