From e294b9b1a3478b9e8a7b69d29b9a59c44fb79787 Mon Sep 17 00:00:00 2001 From: James Paterni Date: Tue, 15 Jul 2025 11:25:02 -0400 Subject: [PATCH] Fix Node.js executable error in Forgejo Actions workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Install Node.js before checkout in all workflows that use actions - Updated ci.yml, test.yml, build.yml, and docker.yml - Updated README.md with fix information - Resolves "exec: node: executable file not found in $PATH" error 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .forgejo/README.md | 7 ++++--- .forgejo/workflows/build.yml | 4 ++++ .forgejo/workflows/ci.yml | 12 ++++++++---- .forgejo/workflows/docker.yml | 12 ++++++++---- .forgejo/workflows/test.yml | 8 ++++---- 5 files changed, 28 insertions(+), 15 deletions(-) diff --git a/.forgejo/README.md b/.forgejo/README.md index 69f7dd8..727e6ec 100644 --- a/.forgejo/README.md +++ b/.forgejo/README.md @@ -174,9 +174,10 @@ git push origin feature-branch exec: "node": executable file not found in $PATH: unknown ``` **Solutions**: - - Use `node-ruby.yml` (Node.js base image with Ruby) - - Use `simple.yml` or `minimal.yml` (shell-based, no Node.js actions) - - Add Node.js to Ruby Alpine: `apk add --no-cache nodejs npm` + - **Fixed in main workflows**: `ci.yml`, `test.yml`, `build.yml`, and `docker.yml` now install Node.js before checkout + - Alternative: Use `node-ruby.yml` (Node.js base image with Ruby) + - Alternative: Use `simple.yml` or `minimal.yml` (shell-based, no Node.js actions) + - Manual fix: Add Node.js to Ruby Alpine: `apk add --no-cache nodejs npm` 2. **Actions not running** - Check if Repository Actions are enabled diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 7feaaa1..60f1a8e 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -13,6 +13,10 @@ jobs: if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) steps: + - name: Install Node.js for actions + run: | + apk add --no-cache nodejs npm + - name: Checkout repository uses: actions/checkout@v4 diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index d23e2b3..a0d5882 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -20,13 +20,13 @@ jobs: working-directory: ./app steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install system dependencies + - name: Install system dependencies including Node.js run: | apk add --no-cache build-base libffi-dev linux-headers postgresql-dev git curl tzdata nodejs npm + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install bundler run: gem install bundler -v 2.6.7 @@ -64,6 +64,10 @@ jobs: if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) steps: + - name: Install Node.js for actions + run: | + apk add --no-cache nodejs npm + - name: Checkout repository uses: actions/checkout@v4 diff --git a/.forgejo/workflows/docker.yml b/.forgejo/workflows/docker.yml index 95e3750..d8e4259 100644 --- a/.forgejo/workflows/docker.yml +++ b/.forgejo/workflows/docker.yml @@ -17,13 +17,13 @@ jobs: working-directory: ./app steps: + - name: Install system dependencies including Node.js + run: | + apk add --no-cache build-base libffi-dev linux-headers postgresql-dev git nodejs npm + - name: Checkout repository uses: actions/checkout@v4 - - name: Install system dependencies - run: | - apk add --no-cache build-base libffi-dev linux-headers postgresql-dev git - - name: Install Ruby dependencies run: | gem install bundler -v 2.6.7 @@ -51,6 +51,10 @@ jobs: if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) steps: + - name: Install Node.js for actions + run: | + apk add --no-cache nodejs npm + - name: Checkout repository uses: actions/checkout@v4 diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml index 5e8f15e..92cbb7c 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -18,13 +18,13 @@ jobs: working-directory: ./app steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install system dependencies + - name: Install system dependencies including Node.js run: | apk add --no-cache build-base libffi-dev linux-headers postgresql-dev git curl tzdata nodejs npm + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install bundler run: gem install bundler -v 2.6.7