Fix Hoarder corepack install/update error (#1957)

Installs Corepack v0.31.0 during Hoarder installation; checks if
Corepack needs updating during Hoarder update.
This commit is contained in:
Chris 2025-02-03 03:06:40 -05:00 committed by GitHub
parent 745d1f9444
commit 91ba5cd412
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

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

View File

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