From a77c439015a601ab1e22a40c447a9be714efa1b4 Mon Sep 17 00:00:00 2001 From: Illya Date: Mon, 8 Dec 2025 16:40:53 -0500 Subject: [PATCH] Fix frontend startup by auto-installing npm dependencies The start script was running `npm run dev` without checking if node_modules existed, causing "vite: command not found" errors for new users who hadn't manually run npm install. Now checks for node_modules and runs npm install automatically if dependencies are missing. --- start_all_services.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/start_all_services.sh b/start_all_services.sh index 06e9bf0..6b836b8 100755 --- a/start_all_services.sh +++ b/start_all_services.sh @@ -194,6 +194,21 @@ if check_port 5173; then fi cd "$PROJECT_DIR/frontend" + +# Check if node_modules exists, install dependencies if not +if [ ! -d "node_modules" ]; then + echo " Installing frontend dependencies..." + npm install > "$PROJECT_DIR/logs/frontend.log" 2>&1 + if [ $? -eq 0 ]; then + echo -e " ${GREEN}✓ Frontend dependencies installed${NC}" + else + echo -e " ${RED}❌ Failed to install frontend dependencies${NC}" + echo " Check logs with: tail -f logs/frontend.log" + cd "$PROJECT_DIR" + exit 1 + fi +fi + nohup npm run dev -- --host 0.0.0.0 > "$PROJECT_DIR/logs/frontend.log" 2>&1 & FRONTEND_PID=$! echo " Frontend PID: $FRONTEND_PID (logging to logs/frontend.log)"