From 18491bd49dfab08e6b04978792418510c9de81da Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:15:02 +0100 Subject: [PATCH] refactor(n8n): simplify update to npm update, clean install deps Update script: - Replace aggressive rm + npm install --force with npm update -g n8n which is the official recommended way to update n8n - Keep legacy migration (env file) and ensure_dependencies Install script: - Remove unnecessary build-essential, python3, python3-setuptools (n8n ships pre-built binaries, no native compilation needed) - Remove ca-certificates (already provided by base image) - Remove patch-package (not used) - Use npm install -g instead of --global for consistency Closes #12250 --- ct/n8n.sh | 18 ++---------------- install/n8n-install.sh | 7 +------ 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/ct/n8n.sh b/ct/n8n.sh index 799f88aab..7a403699b 100644 --- a/ct/n8n.sh +++ b/ct/n8n.sh @@ -41,19 +41,5 @@ EOF NODE_VERSION="22" setup_nodejs - msg_info "Updating ${APP} LXC" - rm -rf /usr/lib/node_modules/.n8n-* /usr/lib/node_modules/n8n - $STD npm install -g n8n --force - systemctl restart n8n - msg_ok "Updated successfully!" - exit -} - -start -build_container -description - -msg_ok "Completed successfully!\n" -echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" -echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5678${CL}" + msg_info "Updating ${APP}" + $STD npm update -g n8n diff --git a/install/n8n-install.sh b/install/n8n-install.sh index 29cf08d4e..8def5cd63 100644 --- a/install/n8n-install.sh +++ b/install/n8n-install.sh @@ -15,18 +15,13 @@ update_os msg_info "Installing Dependencies" $STD apt install -y \ - ca-certificates \ - build-essential \ - python3 \ - python3-setuptools \ graphicsmagick msg_ok "Installed Dependencies" NODE_VERSION="22" setup_nodejs msg_info "Installing n8n (Patience)" -$STD npm install --global patch-package -$STD npm install --global n8n +$STD npm install -g n8n msg_ok "Installed n8n" msg_info "Creating Service"