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
This commit is contained in:
CanbiZ (MickLesk)
2026-02-24 10:15:02 +01:00
parent 72eb8b9575
commit 18491bd49d
2 changed files with 3 additions and 22 deletions

View File

@@ -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

View File

@@ -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"