From 2ee96cd7b10241d3e40adda803ba8218863c16d2 Mon Sep 17 00:00:00 2001 From: Nora Xiao Date: Fri, 29 May 2026 17:23:28 +0000 Subject: [PATCH 1/2] Fix: run npm via shell in start_app.py so it works on Windows 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 --- .scripts/source/start_app.py | 5 ++++- agent-langgraph-advanced/scripts/start_app.py | 5 ++++- agent-langgraph/scripts/start_app.py | 5 ++++- agent-migration-from-model-serving/scripts/start_app.py | 5 ++++- agent-openai-advanced/scripts/start_app.py | 5 ++++- agent-openai-agents-sdk-multiagent/scripts/start_app.py | 5 ++++- agent-openai-agents-sdk/scripts/start_app.py | 5 ++++- 7 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.scripts/source/start_app.py b/.scripts/source/start_app.py index 557fe4e7..8cf9eee0 100644 --- a/.scripts/source/start_app.py +++ b/.scripts/source/start_app.py @@ -243,8 +243,11 @@ def run(self, backend_args=None): frontend_dir = Path("e2e-chatbot-app-next") for cmd, desc in [("npm install", "install"), ("npm run build", "build")]: print(f"Running npm {desc}...") + # shell=True so the command resolves through the platform shell. + # On Windows npm is a .cmd shim that isn't directly executable + # by CreateProcess, so passing a split argv raised FileNotFoundError. result = subprocess.run( - cmd.split(), cwd=frontend_dir, capture_output=True, text=True + cmd, cwd=frontend_dir, capture_output=True, text=True, shell=True ) if result.returncode != 0: print(f"npm {desc} failed: {result.stderr}") diff --git a/agent-langgraph-advanced/scripts/start_app.py b/agent-langgraph-advanced/scripts/start_app.py index 557fe4e7..8cf9eee0 100644 --- a/agent-langgraph-advanced/scripts/start_app.py +++ b/agent-langgraph-advanced/scripts/start_app.py @@ -243,8 +243,11 @@ def run(self, backend_args=None): frontend_dir = Path("e2e-chatbot-app-next") for cmd, desc in [("npm install", "install"), ("npm run build", "build")]: print(f"Running npm {desc}...") + # shell=True so the command resolves through the platform shell. + # On Windows npm is a .cmd shim that isn't directly executable + # by CreateProcess, so passing a split argv raised FileNotFoundError. result = subprocess.run( - cmd.split(), cwd=frontend_dir, capture_output=True, text=True + cmd, cwd=frontend_dir, capture_output=True, text=True, shell=True ) if result.returncode != 0: print(f"npm {desc} failed: {result.stderr}") diff --git a/agent-langgraph/scripts/start_app.py b/agent-langgraph/scripts/start_app.py index 557fe4e7..8cf9eee0 100644 --- a/agent-langgraph/scripts/start_app.py +++ b/agent-langgraph/scripts/start_app.py @@ -243,8 +243,11 @@ def run(self, backend_args=None): frontend_dir = Path("e2e-chatbot-app-next") for cmd, desc in [("npm install", "install"), ("npm run build", "build")]: print(f"Running npm {desc}...") + # shell=True so the command resolves through the platform shell. + # On Windows npm is a .cmd shim that isn't directly executable + # by CreateProcess, so passing a split argv raised FileNotFoundError. result = subprocess.run( - cmd.split(), cwd=frontend_dir, capture_output=True, text=True + cmd, cwd=frontend_dir, capture_output=True, text=True, shell=True ) if result.returncode != 0: print(f"npm {desc} failed: {result.stderr}") diff --git a/agent-migration-from-model-serving/scripts/start_app.py b/agent-migration-from-model-serving/scripts/start_app.py index 557fe4e7..8cf9eee0 100644 --- a/agent-migration-from-model-serving/scripts/start_app.py +++ b/agent-migration-from-model-serving/scripts/start_app.py @@ -243,8 +243,11 @@ def run(self, backend_args=None): frontend_dir = Path("e2e-chatbot-app-next") for cmd, desc in [("npm install", "install"), ("npm run build", "build")]: print(f"Running npm {desc}...") + # shell=True so the command resolves through the platform shell. + # On Windows npm is a .cmd shim that isn't directly executable + # by CreateProcess, so passing a split argv raised FileNotFoundError. result = subprocess.run( - cmd.split(), cwd=frontend_dir, capture_output=True, text=True + cmd, cwd=frontend_dir, capture_output=True, text=True, shell=True ) if result.returncode != 0: print(f"npm {desc} failed: {result.stderr}") diff --git a/agent-openai-advanced/scripts/start_app.py b/agent-openai-advanced/scripts/start_app.py index 557fe4e7..8cf9eee0 100644 --- a/agent-openai-advanced/scripts/start_app.py +++ b/agent-openai-advanced/scripts/start_app.py @@ -243,8 +243,11 @@ def run(self, backend_args=None): frontend_dir = Path("e2e-chatbot-app-next") for cmd, desc in [("npm install", "install"), ("npm run build", "build")]: print(f"Running npm {desc}...") + # shell=True so the command resolves through the platform shell. + # On Windows npm is a .cmd shim that isn't directly executable + # by CreateProcess, so passing a split argv raised FileNotFoundError. result = subprocess.run( - cmd.split(), cwd=frontend_dir, capture_output=True, text=True + cmd, cwd=frontend_dir, capture_output=True, text=True, shell=True ) if result.returncode != 0: print(f"npm {desc} failed: {result.stderr}") diff --git a/agent-openai-agents-sdk-multiagent/scripts/start_app.py b/agent-openai-agents-sdk-multiagent/scripts/start_app.py index 557fe4e7..8cf9eee0 100644 --- a/agent-openai-agents-sdk-multiagent/scripts/start_app.py +++ b/agent-openai-agents-sdk-multiagent/scripts/start_app.py @@ -243,8 +243,11 @@ def run(self, backend_args=None): frontend_dir = Path("e2e-chatbot-app-next") for cmd, desc in [("npm install", "install"), ("npm run build", "build")]: print(f"Running npm {desc}...") + # shell=True so the command resolves through the platform shell. + # On Windows npm is a .cmd shim that isn't directly executable + # by CreateProcess, so passing a split argv raised FileNotFoundError. result = subprocess.run( - cmd.split(), cwd=frontend_dir, capture_output=True, text=True + cmd, cwd=frontend_dir, capture_output=True, text=True, shell=True ) if result.returncode != 0: print(f"npm {desc} failed: {result.stderr}") diff --git a/agent-openai-agents-sdk/scripts/start_app.py b/agent-openai-agents-sdk/scripts/start_app.py index 557fe4e7..8cf9eee0 100644 --- a/agent-openai-agents-sdk/scripts/start_app.py +++ b/agent-openai-agents-sdk/scripts/start_app.py @@ -243,8 +243,11 @@ def run(self, backend_args=None): frontend_dir = Path("e2e-chatbot-app-next") for cmd, desc in [("npm install", "install"), ("npm run build", "build")]: print(f"Running npm {desc}...") + # shell=True so the command resolves through the platform shell. + # On Windows npm is a .cmd shim that isn't directly executable + # by CreateProcess, so passing a split argv raised FileNotFoundError. result = subprocess.run( - cmd.split(), cwd=frontend_dir, capture_output=True, text=True + cmd, cwd=frontend_dir, capture_output=True, text=True, shell=True ) if result.returncode != 0: print(f"npm {desc} failed: {result.stderr}") From fd1baeb71dd15879ac88f79c328b633c93858a80 Mon Sep 17 00:00:00 2001 From: Nora Xiao Date: Fri, 29 May 2026 17:46:19 +0000 Subject: [PATCH 2/2] Remove explanatory comments from npm shell fix Co-authored-by: Isaac --- .scripts/source/start_app.py | 3 --- agent-langgraph-advanced/scripts/start_app.py | 3 --- agent-langgraph/scripts/start_app.py | 3 --- agent-migration-from-model-serving/scripts/start_app.py | 3 --- agent-openai-advanced/scripts/start_app.py | 3 --- agent-openai-agents-sdk-multiagent/scripts/start_app.py | 3 --- agent-openai-agents-sdk/scripts/start_app.py | 3 --- 7 files changed, 21 deletions(-) diff --git a/.scripts/source/start_app.py b/.scripts/source/start_app.py index 8cf9eee0..dfe5cde2 100644 --- a/.scripts/source/start_app.py +++ b/.scripts/source/start_app.py @@ -243,9 +243,6 @@ def run(self, backend_args=None): frontend_dir = Path("e2e-chatbot-app-next") for cmd, desc in [("npm install", "install"), ("npm run build", "build")]: print(f"Running npm {desc}...") - # shell=True so the command resolves through the platform shell. - # On Windows npm is a .cmd shim that isn't directly executable - # by CreateProcess, so passing a split argv raised FileNotFoundError. result = subprocess.run( cmd, cwd=frontend_dir, capture_output=True, text=True, shell=True ) diff --git a/agent-langgraph-advanced/scripts/start_app.py b/agent-langgraph-advanced/scripts/start_app.py index 8cf9eee0..dfe5cde2 100644 --- a/agent-langgraph-advanced/scripts/start_app.py +++ b/agent-langgraph-advanced/scripts/start_app.py @@ -243,9 +243,6 @@ def run(self, backend_args=None): frontend_dir = Path("e2e-chatbot-app-next") for cmd, desc in [("npm install", "install"), ("npm run build", "build")]: print(f"Running npm {desc}...") - # shell=True so the command resolves through the platform shell. - # On Windows npm is a .cmd shim that isn't directly executable - # by CreateProcess, so passing a split argv raised FileNotFoundError. result = subprocess.run( cmd, cwd=frontend_dir, capture_output=True, text=True, shell=True ) diff --git a/agent-langgraph/scripts/start_app.py b/agent-langgraph/scripts/start_app.py index 8cf9eee0..dfe5cde2 100644 --- a/agent-langgraph/scripts/start_app.py +++ b/agent-langgraph/scripts/start_app.py @@ -243,9 +243,6 @@ def run(self, backend_args=None): frontend_dir = Path("e2e-chatbot-app-next") for cmd, desc in [("npm install", "install"), ("npm run build", "build")]: print(f"Running npm {desc}...") - # shell=True so the command resolves through the platform shell. - # On Windows npm is a .cmd shim that isn't directly executable - # by CreateProcess, so passing a split argv raised FileNotFoundError. result = subprocess.run( cmd, cwd=frontend_dir, capture_output=True, text=True, shell=True ) diff --git a/agent-migration-from-model-serving/scripts/start_app.py b/agent-migration-from-model-serving/scripts/start_app.py index 8cf9eee0..dfe5cde2 100644 --- a/agent-migration-from-model-serving/scripts/start_app.py +++ b/agent-migration-from-model-serving/scripts/start_app.py @@ -243,9 +243,6 @@ def run(self, backend_args=None): frontend_dir = Path("e2e-chatbot-app-next") for cmd, desc in [("npm install", "install"), ("npm run build", "build")]: print(f"Running npm {desc}...") - # shell=True so the command resolves through the platform shell. - # On Windows npm is a .cmd shim that isn't directly executable - # by CreateProcess, so passing a split argv raised FileNotFoundError. result = subprocess.run( cmd, cwd=frontend_dir, capture_output=True, text=True, shell=True ) diff --git a/agent-openai-advanced/scripts/start_app.py b/agent-openai-advanced/scripts/start_app.py index 8cf9eee0..dfe5cde2 100644 --- a/agent-openai-advanced/scripts/start_app.py +++ b/agent-openai-advanced/scripts/start_app.py @@ -243,9 +243,6 @@ def run(self, backend_args=None): frontend_dir = Path("e2e-chatbot-app-next") for cmd, desc in [("npm install", "install"), ("npm run build", "build")]: print(f"Running npm {desc}...") - # shell=True so the command resolves through the platform shell. - # On Windows npm is a .cmd shim that isn't directly executable - # by CreateProcess, so passing a split argv raised FileNotFoundError. result = subprocess.run( cmd, cwd=frontend_dir, capture_output=True, text=True, shell=True ) diff --git a/agent-openai-agents-sdk-multiagent/scripts/start_app.py b/agent-openai-agents-sdk-multiagent/scripts/start_app.py index 8cf9eee0..dfe5cde2 100644 --- a/agent-openai-agents-sdk-multiagent/scripts/start_app.py +++ b/agent-openai-agents-sdk-multiagent/scripts/start_app.py @@ -243,9 +243,6 @@ def run(self, backend_args=None): frontend_dir = Path("e2e-chatbot-app-next") for cmd, desc in [("npm install", "install"), ("npm run build", "build")]: print(f"Running npm {desc}...") - # shell=True so the command resolves through the platform shell. - # On Windows npm is a .cmd shim that isn't directly executable - # by CreateProcess, so passing a split argv raised FileNotFoundError. result = subprocess.run( cmd, cwd=frontend_dir, capture_output=True, text=True, shell=True ) diff --git a/agent-openai-agents-sdk/scripts/start_app.py b/agent-openai-agents-sdk/scripts/start_app.py index 8cf9eee0..dfe5cde2 100644 --- a/agent-openai-agents-sdk/scripts/start_app.py +++ b/agent-openai-agents-sdk/scripts/start_app.py @@ -243,9 +243,6 @@ def run(self, backend_args=None): frontend_dir = Path("e2e-chatbot-app-next") for cmd, desc in [("npm install", "install"), ("npm run build", "build")]: print(f"Running npm {desc}...") - # shell=True so the command resolves through the platform shell. - # On Windows npm is a .cmd shim that isn't directly executable - # by CreateProcess, so passing a split argv raised FileNotFoundError. result = subprocess.run( cmd, cwd=frontend_dir, capture_output=True, text=True, shell=True )