Gitea actions: “Cannot find: node in PATH”

I’m failing to get actions/checkout@v3 to run on a windows host.

The crazy thing is when I start the act runner with “ubuntu” as label and change the “runs-on: windows” in the workflow yml also to “runs-on: ubuntu” the checkout works fine. But then I run into issues in later actions steps.

I don’t know how to debug any further. Any ideas?

My workflow yml:

name: compile
run-name: ${{ gitea.actor }} is testing out Gitea Actions
on: [push]
jobs:
  Explore-Gitea-Actions:
    runs-on: windows
    steps: 
      - name: Check out repository code   
        uses: actions/checkout@v3

Output oft he act_runner

[compile/Explore-Gitea-Actions] [DEBUG] expression '${{ github.repository }}' rewritten to 'format('{0}', github.repository)'
[compile/Explore-Gitea-Actions] [DEBUG] evaluating expression 'format('{0}', github.repository)'
[compile/Explore-Gitea-Actions] [DEBUG] expression 'format('{0}', github.repository)' evaluated to '%!t(string=Bentec-Test/AFE-Semistack-Private)'
[compile/Explore-Gitea-Actions] [DEBUG] expression '${{ github.token }}' rewritten to 'format('{0}', github.token)'
[compile/Explore-Gitea-Actions] [DEBUG] evaluating expression 'format('{0}', github.token)'
[compile/Explore-Gitea-Actions] [DEBUG] expression 'format('{0}', github.token)' evaluated to '%!t(string=***)'
[compile/Explore-Gitea-Actions] [DEBUG] type=remote-action actionDir=C:\Users\Drone\.cache\act/actions-checkout@v3 actionPath= workdir=\C:\Users\Drone\.cache\act\Test\Test_repo actionCacheDir=C:\Users\Drone\.cache\act actionName=actions-checkout@v3 containerActionDir=C:/Users/Drone/.cache/act/bdafc7e2f02359b7/act/actions/actions-checkout@v3
[compile/Explore-Gitea-Actions] [DEBUG] Removing C:\Users\Drone\.cache\act/actions-checkout@v3/.gitignore before docker cp
[compile/Explore-Gitea-Actions] [DEBUG] C:/Users/Drone/.cache/act/bdafc7e2f02359b7/act/actions/actions-checkout@v3
[compile/Explore-Gitea-Actions] [DEBUG] Stripping prefix:C:\Users\Drone\.cache\act\actions-checkout@v3\ src:C:\Users\Drone\.cache\act/actions-checkout@v3/
[compile/Explore-Gitea-Actions] [DEBUG] executing remote job container: [node C:/Users/Drone/.cache/act/bdafc7e2f02359b7/act/actions/actions-checkout@v3/dist/index.js]
| Cannot find: node in PATH
[compile/Explore-Gitea-Actions]   ❌  Failure - Main Check out repository code
[compile/Explore-Gitea-Actions] Cannot find: node in PATH
1 Like

Hi, for (most) Actions node is required to be installed. In the default container image that is used node is installed, but for host-mode (which you are using for running on windows) you’ll need to install node on your host.

1 Like

@techknowlogick same issue here with the docker image of gitea actions. I fixed it with
apk add --no-cache nodejs

but shoulnd’t this be already included in the official docker image?

I eperience the same issue:
I’m using a docker-compose deployment for both gitea & act runner ; docker-compose file is equivalent to to one of the example: gitea/act_runner/src/branch/main/examples/docker-compose

version: "3.4"

services:

  gitea:
    container_name: gitea
    restart: always
    image: gitea/gitea:latest
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - GITEA__server__HTTP_PORT=80
      - GITEA__server__DOMAIN=git.lan
      - GITEA__server__SSH_DOMAIN=gitea.lan
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - /data/gitea:/data:rw
    cap_add:
      - NET_ADMIN

  gitea_runner:
    container_name: gitea_runner
    image: gitea/act_runner
    restart: always
    depends_on:
      - gitea
    volumes:
      - /data/gitea_runner:/data
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      GITEA_INSTANCE_URL: "http://gitea.lan"
      GITEA_RUNNER_REGISTRATION_TOKEN: "xxx"

My workflow file is also the same as found in gitea’s documentation:

name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions
on: [push]

jobs:
  Explore-Gitea-Actions:
    runs-on: ubuntu-latest
    steps:
      - run: echo " The job was automatically triggered by a ${{ gitea.event_name }} event."
      - run: echo " This job is now running on a ${{ runner.os }} server hosted by Gitea!"
      - run: echo " The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
      - run: env
      - name: Check out repository code
        uses: actions/checkout@v3

Despite of that, I get the same error for step actions/checkout@v3:

OCI runtime exec failed: exec failed: unable to start container process: exec: "node": executable file not found in $PATH: unknown

Note: my host is based on an ARM64 architecture.

Also in my case, trying to manually install nodejs in act_runner image didn’t solved the issue

docker exec gitea_runner apk add --no-cache nodejs

Ok, I found the root cause of the error: the labels defined in the config file .runner weren’t appropriate.

replacing with those provided in gitea doc did the thing: Act Runner | Gitea Documentation

3 Likes

still seems to be a thing and replacing the labels in .runner file worked for me too!

however I wanna add that the linked doc still suggests node-16, while node-20 is the default since act-runner 0.2.9