mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3162] Windows: staging server build fails with 'C:\Program' is not recognized (unquoted process.execPath through cmd shell in packages/server/scripts/build.mjs) #1697
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1697
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Jul 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3162
Originally assigned to: @kolacheee on GitHub.
Summary
On
staging,pnpm check(andpnpm build) fails on Windows whenever Node.js is installed in a path containing a space — which is the default installer location,C:\Program Files\nodejs. The server package build aborts with:Root cause
packages/server/scripts/build.mjs(introduced in #3157) runs its final step as:where the
run()helper callsspawnSyncwithshell: process.platform === "win32". Withshell: true, Node concatenates the command and args into a single unquotedcmd.exe /cline, soC:\Program Files\nodejs\node.exeis split at the space and cmd tries to executeC:\Program. Node 22+ even emitsDEP0190warning about exactly this pattern.The script-path argument has the same exposure: if the repo is cloned under a directory with a space in it, the unquoted arg breaks identically even when Node itself lives in a space-free path.
Reproduction
On any Windows machine with Node under
C:\Program Files\nodejs:Output:
Or simply run
pnpm checkonstaging— the server build step exits non-zero aftertsccompletes.Scope check (other call sites)
I swept the other
spawnSync/execFilecall sites onstagingfor the same pattern:packages/client/scripts/build.mjs— samerun()helper, but only invokestsc/vite, which are bare.cmdshim names that genuinely needshell: trueon Windows. Not affected.packages/server/scripts/write-build-meta.mjs,scripts/check-tracked-installers.mjs— invoke baregitwith the shell. Works; unaffected.packages/server/scripts/run-tests.mjs,scripts/check-impeccable-context.mjs— already spawnprocess.execPathwithout a shell, which is the correct pattern.So the fix is confined to the one call in
packages/server/scripts/build.mjs.Suggested fix
Spawning
node.exedirectly needs no shell (it's a real executable, not a.cmdshim). Letrun()accept a per-callshelloverride and passshell: falsefor thewrite-build-meta.mjsinvocation. This also fixes the spaced-repo-path case, since without a shell the args are passed verbatim.Environment
C:\Program Files\nodejsstaging(bug is not onmain—packages/server/scripts/build.mjsonly exists on staging)Taking this one myself — small fix PR against
stagingto follow shortly. (owner: @kolacheee)