From 14e000caaf9e4a2ad17a36aaf46370191803af48 Mon Sep 17 00:00:00 2001 From: oguz-work Date: Thu, 7 Aug 2025 18:26:19 +0300 Subject: [PATCH] fix(server): add shell=True to npm subprocess calls for Windows compatibility fix(server): add shell=True to npm subprocess calls for Windows compatibility --- server.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server.py b/server.py index 5e51d4f4f..4a9ac42b5 100644 --- a/server.py +++ b/server.py @@ -142,7 +142,7 @@ async def enable_cors(request, response): async def start_vue_dev_server(): await asyncio.create_subprocess_shell( - "npm run dev", stdout=sys.stdout, stderr=sys.stderr, cwd=MAGMA_PATH + "npm run dev", stdout=sys.stdout, stderr=sys.stderr, cwd=MAGMA_PATH, shell=True ) logging.info("VueJS development server is live.") @@ -256,15 +256,15 @@ def list_str(values): if args.uiDevHost: if not os.path.exists(f"{MAGMA_PATH}/dist"): logging.info("Building VueJS front-end.") - subprocess.run(["npm", "run", "build"], cwd=MAGMA_PATH, check=True) + subprocess.run(["npm", "run", "build"], cwd=MAGMA_PATH, check=True, shell=True) logging.info("VueJS front-end build complete.") app_svc.application.on_response_prepare.append(enable_cors) if args.build: if len(os.listdir(MAGMA_PATH)) > 0: logging.info("Building VueJS front-end.") - subprocess.run(["npm", "install"], cwd=MAGMA_PATH, check=True) - subprocess.run(["npm", "run", "build"], cwd=MAGMA_PATH, check=True) + subprocess.run(["npm", "install"], cwd=MAGMA_PATH, check=True, shell=True) + subprocess.run(["npm", "run", "build"], cwd=MAGMA_PATH, check=True, shell=True) logging.info("VueJS front-end build complete.") else: logging.warning(