From e55808ec31a7dda613d85325a7c70987cbdcf497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davor=20Raci=C4=87?= Date: Sun, 8 Feb 2026 15:51:43 +0100 Subject: [PATCH] fix: suppress non-fatal module post-install script errors Post-install scripts fail due to CJS/ESM incompatibility but module files are already copied successfully. Silently catch the error instead of showing a warning that alarms users into thinking installation failed. Co-Authored-By: Claude Opus 4.6 --- tools/cli/installers/lib/modules/manager.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/cli/installers/lib/modules/manager.js b/tools/cli/installers/lib/modules/manager.js index a58b506d1..a0b50048c 100644 --- a/tools/cli/installers/lib/modules/manager.js +++ b/tools/cli/installers/lib/modules/manager.js @@ -1327,11 +1327,12 @@ class ModuleManager { await prompts.log.warn(`Module installer for ${moduleName} returned false`); } } - } catch (error) { - await prompts.log.warn( - `Post-install script for ${moduleName} could not run: ${error.message}\n` + - ` The module itself was installed successfully. The post-install script is optional.`, - ); + } catch { + // Post-install scripts are optional; module files are already installed. + // TODO: Eliminate post-install scripts entirely by adding a `directories` key + // to module.yaml that declares which config keys are paths to auto-create. + // The main installer can then handle directory creation centrally, removing + // the need for per-module installer.js scripts and their CJS/ESM issues. } }