From 2d4fce935f54169116671ddb7832f91c47c5bcdc Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Sun, 1 Mar 2026 18:03:31 -0800 Subject: [PATCH] fix: remove old Node.js before installing v22 on Linux runner The Act runner has Node 18 at /usr/local/bin/node which takes precedence over the apt-installed /usr/bin/node. Even after running nodesource setup and apt-get install, the old Node 18 binary remained in the PATH. Now removes old binaries and uses hash -r to force path re-lookup. Also removes package-lock.json before npm install to ensure correct platform-specific bindings. Co-Authored-By: Claude Opus 4.6 --- .gitea/workflows/build-app.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/build-app.yml b/.gitea/workflows/build-app.yml index b7f8fc1..8392604 100644 --- a/.gitea/workflows/build-app.yml +++ b/.gitea/workflows/build-app.yml @@ -25,9 +25,11 @@ jobs: NEED_INSTALL=false if command -v node >/dev/null 2>&1; then NODE_MAJOR=$(node --version | sed 's/v\([0-9]*\).*/\1/') - echo "Found Node.js $(node --version) (major: ${NODE_MAJOR})" + echo "Found Node.js $(node --version) at $(which node) (major: ${NODE_MAJOR})" if [ "$NODE_MAJOR" -lt 22 ]; then - echo "Node.js ${NODE_MAJOR} is too old, upgrading to 22..." + echo "Node.js ${NODE_MAJOR} is too old, removing before installing 22..." + sudo rm -f /usr/local/bin/node /usr/local/bin/npm /usr/local/bin/npx /usr/local/bin/corepack + hash -r NEED_INSTALL=true fi else @@ -37,7 +39,9 @@ jobs: if [ "$NEED_INSTALL" = true ]; then curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt-get install -y nodejs + hash -r fi + echo "Node.js at: $(which node)" node --version npm --version @@ -97,7 +101,7 @@ jobs: - name: Install frontend dependencies working-directory: ./app run: | - rm -rf node_modules + rm -rf node_modules package-lock.json npm install - name: Install Tauri CLI