Skip to content

fix(demo): launch npm through Node on Windows - #81

Merged
viktar-b merged 2 commits into
mainfrom
codex/windows-npm-launch
Sep 30, 2026
Merged

viktar-b merged 2 commits into
mainfrom
codex/windows-npm-launch

Conversation

@viktar-b

@viktar-b viktar-b commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Why

The root demo commands spawn bare npm, which fails with ENOENT on native Windows. Invoke npm's JavaScript entry through the current Node executable with an argument array and no shell.

Fixes #78.

Scope

  • Validate the npm entry before preparing canonical examples and direct script users to npm run dev or npm run build:demo.
  • Preserve forwarded arguments, environment variables, child stderr and exit status. Report child signal termination.
  • Exercise the launcher through real child processes, including empty PATH, space/Unicode npm paths and shell metacharacters in arguments.

Verification

  • The baseline failed all eight initial regression cases. Forwarding failed with spawnSync npm ENOENT despite a valid npm_execpath.
  • node node_modules/vitest/vitest.mjs run tests/integration/demo-launch.test.ts: nine tests passed on macOS with Node 24. The signal case runs on POSIX hosts.
  • Scoped Biome lint, workspace lint and npm run typecheck passed.
  • The focused launcher/example integration checks passed all 12 cases. Demo workspace tests passed all nine cases.
  • Real npm run build:demo -- --help forwarding passed with an explicit examples directory. The full default npm run build:demo also passed with an independently installed wheel.
  • Native Windows verification is pending.

@vercel

vercel Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
calculation-source-object Ready Ready Preview Sep 30, 2026 9:37am UTC

Request Review

@viktar-b

Copy link
Copy Markdown
Owner Author

Independent verification: PASS+NOTES. No blocking code or scoped-comment findings.

Reviewed head faff12d2cf50e995fa67ff72dd800feb5669ab7e against base 48672ce0c0788561c9570aa571f2067c2be1fc4a. Stable patch ID a46b82ec4f06e3377b6d04424501ec2ae1f983ce.

I did not author this PR. The old launcher failed with spawnSync npm ENOENT when PATH contained the shell but no npm. The changed launcher reached a real npm workspace child and preserved space/Unicode paths, quoted and metacharacter arguments, empty arguments, environment, stderr, and exit 23. All nine focused tests and scoped lint passed. Actual default preparation left no owned temporary directories after successful launch, child failure, or preparation failure. The diff contains no comments or type/lint suppressions.

I inspected the exact-head Windows job. Its checkout and environment log confirm this head on Windows Server 2025, Node 24.21.0 and PowerShell 7.6.6. Eight tests passed, the POSIX signal test was intentionally skipped, and real npm reached next build --help. All five required PR checks passed at the reviewed head.

PowerShell 5.1 and Windows 11 foreground Ctrl+C/restart remain part of later support qualification. Main advanced during review, so the owner must integrate current main, compare the patch ID, and rerun merge gates before the coordinator authorizes landing.

@viktar-b

Copy link
Copy Markdown
Owner Author

Root verification PASS at 1591acf1308c31276e98e9f51715ca0008fedd13 against main ea04d2dedc73021a9754301206502129c668889f.

The independent non-author reviewer recorded PASS+NOTES above. I verified the refreshed diff retains stable patch ID a46b82ec4f06e3377b6d04424501ec2ae1f983ce. The launcher patch is unchanged. Its base includes the portable bindings fix.

Exact-patch native Windows proof passed argument forwarding, environment, exit handling and a real npm child. Independent live review also verified preparation cleanup and baseline ENOENT. Current-head quality, isolation, installed-packages, dependency-review, PR-title and CodeQL pass. GitHub reports CLEAN and MERGEABLE, with no unresolved threads. Normal protected merge is authorized for this head only.

@viktar-b
viktar-b merged commit 5b8c66f into main Sep 30, 2026
12 checks passed
@viktar-b
viktar-b deleted the codex/windows-npm-launch branch September 30, 2026 09:43

This branch was successfully deployed

1 active deployment
Preview — 1591acf1 Deployed Sep 30, 2026 by vercel[bot]
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.

fix(demo): npm launcher fails with ENOENT on native Windows

1 participant