Skip to content

Fix: run npm via shell in start_app.py so it works on Windows#225

Open
noramxiao wants to merge 2 commits into
mainfrom
fix/windows-start-app-shell
Open

Fix: run npm via shell in start_app.py so it works on Windows#225
noramxiao wants to merge 2 commits into
mainfrom
fix/windows-start-app-shell

Conversation

@noramxiao
Copy link
Copy Markdown

@noramxiao noramxiao commented May 29, 2026

Problem

On Windows, uv run start-app fails with FileNotFoundError during frontend setup. start_app.py runs the npm commands as:

subprocess.run(cmd.split(), cwd=frontend_dir, capture_output=True, text=True)

npm on Windows is a .cmd shim that CreateProcess can't execute directly, so passing a split argv (["npm", "install"]) raises FileNotFoundError. Reported in #126.

Change

subprocess.run(cmd, cwd=frontend_dir, capture_output=True, text=True, shell=True)

Passing the command string with shell=True resolves the executable through the platform shell on Windows (cmd.exe), macOS, and Linux (/bin/sh -c), so the same code works everywhere. This matches the fix suggested by the reporter.

Fixes #126

noramxiao added 2 commits May 29, 2026 17:23
start_app.py invoked `subprocess.run(cmd.split(), ...)` for `npm install` and
`npm run build`. On Windows npm is a `.cmd` shim that CreateProcess cannot
execute directly, so a split argv raised FileNotFoundError. Pass the command
string with shell=True so it resolves through the platform shell on Windows,
macOS, and Linux.

Edited the synced source (.scripts/source/start_app.py) and propagated to all
templates via `python .scripts/sync-scripts.py`.

Fixes #126

Co-authored-by: Isaac
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.

Issue in start_app.py when running on Windows

1 participant