From df61e3c16377d265ae8cb73b8942aa078eb262fc Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Thu, 23 Jan 2025 15:05:20 +0100 Subject: [PATCH] skip installing dependency if no package.json --- core/agents/orchestrator.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/agents/orchestrator.py b/core/agents/orchestrator.py index 226b4146e..8a75e00d7 100644 --- a/core/agents/orchestrator.py +++ b/core/agents/orchestrator.py @@ -117,7 +117,13 @@ async def run(self) -> bool: return True async def install_dependencies(self): - # Check if node_modules directory exists + # First check if package.json exists + package_json_path = os.path.join(self.state_manager.get_full_project_root(), "package.json") + if not os.path.exists(package_json_path): + # Skip if no package.json found + return + + # Then check if node_modules directory exists node_modules_path = os.path.join(self.state_manager.get_full_project_root(), "node_modules") if not os.path.exists(node_modules_path): await self.send_message("Installing project dependencies...")