From 27045fef55cc6e39c7c00ba3828e9745f7746ea7 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Wed, 2 Dec 2026 13:30:17 +0100 Subject: [PATCH] n8n: update with an empty npm cache and the service stopped (#19262) * n8n: update with an empty npm cache and the service stopped Reinstalling n8n over itself made npm peak at 3.9 GB with a warm cache and 1.4 GB with an empty one; with n8n still running beside it a 2 GB container was killed (exit 137, six updates in five days). The update now stops n8n and clears the npm cache first. * refactor comment --------- Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com> --- ct/n8n.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ct/n8n.sh b/ct/n8n.sh index a390c89e4..3f7141aab 100644 --- a/ct/n8n.sh +++ b/ct/n8n.sh @@ -49,8 +49,11 @@ EOF # n8n-nodes-base 2.46.0 pins both @napi-rs/canvas musl binaries as hard # dependencies, which no os/cpu/libc combination can satisfy. Drop --force # once upstream makes them optional again. + # prevent excessive ram use by clearing cache + systemctl stop n8n + $STD npm cache clean --force $STD npm install -g n8n@latest --force - systemctl restart n8n + systemctl start n8n msg_ok "Updated n8n" msg_ok "Updated successfully!" exit