diff --git a/gateway/platforms/whatsapp.py b/gateway/platforms/whatsapp.py index 2fb6fc13329..29b78d75d01 100644 --- a/gateway/platforms/whatsapp.py +++ b/gateway/platforms/whatsapp.py @@ -494,12 +494,15 @@ class WhatsAppAdapter(BasePlatformAdapter): # plain executable path. _npm_bin = shutil.which("npm") or "npm" try: + # Read timeout from environment variable, default to 300 seconds (5 minutes) + # to accommodate slower systems like Unraid NAS + npm_install_timeout = int(os.environ.get("WHATSAPP_NPM_INSTALL_TIMEOUT", "300")) install_result = subprocess.run( [_npm_bin, "install", "--silent"], cwd=str(bridge_dir), capture_output=True, text=True, - timeout=60, + timeout=npm_install_timeout, ) if install_result.returncode != 0: print(f"[{self.name}] npm install failed: {install_result.stderr}")