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>
This commit is contained in:
CanbiZ (MickLesk)andTobias authored and GitHub committed 2026-12-02 13:30:17 +01:00
1 parent e7eaf9508e
commit 27045fef55
1 file changed
+4 -1
+4 -1
View File
@@ -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