From 91ba5cd412129db2767b4ba1aa2ec3dea9af3521 Mon Sep 17 00:00:00 2001 From: Chris <67816022+vhsdream@users.noreply.github.com> Date: Mon, 3 Feb 2025 03:06:40 -0500 Subject: [PATCH] Fix Hoarder corepack install/update error (#1957) Installs Corepack v0.31.0 during Hoarder installation; checks if Corepack needs updating during Hoarder update. --- ct/hoarder.sh | 3 +++ install/hoarder-install.sh | 1 + 2 files changed, 4 insertions(+) diff --git a/ct/hoarder.sh b/ct/hoarder.sh index 5a905ad2..0b6cd1a6 100644 --- a/ct/hoarder.sh +++ b/ct/hoarder.sh @@ -39,6 +39,9 @@ function update_script() { systemctl stop hoarder-web hoarder-workers hoarder-browser msg_ok "Stopped Services" msg_info "Updating ${APP} to v${RELEASE}" + if [[ $(corepack -v) < "0.31.0" ]]; then + npm install -g corepack@0.31.0 &>/dev/null + fi cd /opt if [[ -f /opt/hoarder/.env ]] && [[ ! -f /etc/hoarder/hoarder.env ]]; then mkdir -p /etc/hoarder diff --git a/install/hoarder-install.sh b/install/hoarder-install.sh index a513460c..afa0a9a6 100644 --- a/install/hoarder-install.sh +++ b/install/hoarder-install.sh @@ -56,6 +56,7 @@ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dea echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list $STD apt-get update $STD apt-get install -y nodejs +$STD npm install -g corepack@0.31.0 msg_ok "Installed Node.js" msg_info "Installing Hoarder"