act: Seemingly invalid path separator on Windows using actions/setup-node

Running command

act -P ubuntu-latest=nektos/act-environments-ubuntu:18.04

on Microsoft Windows 10 Pro Build 10.0.18363 using release v0.2.6

- name: Set up Node.js version 13.x
  uses: actions/setup-node@v1
  with:
    node-version: 13.x

results in

[Continuous Delivery/Node 13.x]   �🐳  docker cp src=act/actions-setup-node@v1 dst=/actions\
| internal/modules/cjs/loader.js:985
|   throw err;
|   ^
|
| Error: Cannot find module '/github/workspace/\actions\actions-setup-node@v1\dist\index.js'
|     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
|     at Function.Module._load (internal/modules/cjs/loader.js:864:27)
|     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
|     at internal/main/run_main_module.js:18:47 {
|   code: 'MODULE_NOT_FOUND',
|   requireStack: []
| }
[Continuous Delivery/Node 13.x]   ❌  Failure - Set up Node.js version 13.x
Error: exit with `FAILURE`: 1

This seems to be an issue with Windows and POSIX not using the same path separators. However I don’t know where this issue lies, if its with nektos/act or actions/setup-node. If you can’t reproduce the issue it occurs currently with trutoo/event-bus. It does however work in in my WSL.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 17
  • Comments: 18 (3 by maintainers)

Most upvoted comments

Windows users, please make sure you’re on “Linux Container”. To check, right-click on Docker Desktop from task bar and choose “Switch to Linux Container”. This will solve the problem.

This works, irrespective of your windows version compatible with WSL2 or not.

Windows users, please make sure you’re on “Linux Container”. To check, right-click on Docker Desktop from task bar and choose “Switch to Linux Container”. This will solve the problem.

Docker Desktop is running Linux containers in my case.

Hi, I would like to point out, that I could not replicate the workaround. I am running Docker Version 2.3.0.3 (45519) with WSL2 on a freshly updated Windows 10 Pro.

Sadly, I have nothing to contribute. Just issues reproducing the workaround 😦

I’m running into this today, Windows 10 x64 with Latest Docker, github action running against ubuntu-latest, act version 0.2.9:

  node:
    name: Installing Node 12 and required project packages
    runs-on: ubuntu-latest
    shell: bash
    steps:
      - uses: actions/checkout@master
        with:
          fetch-depth: 0
      - uses: actions/setup-node@v1
        with:
          node-version: '12'
      - name: Installing dependencies
        run: npm install

Result:

[CI-CD/Installing Node 12 and required project packages    ]   �🐳  docker cp src=act/actions-setup-node@v1 dst=/actions\
| internal/modules/cjs/loader.js:628
|     throw err;
|     ^
|
| Error: Cannot find module '/github/workspace/\actions\actions-setup-node@v1\dist\index.js'
|     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
|     at Function.Module._load (internal/modules/cjs/loader.js:527:27)
|     at Function.Module.runMain (internal/modules/cjs/loader.js:839:10)
|     at internal/main/run_main_module.js:17:11 {
|   code: 'MODULE_NOT_FOUND',
|   requireStack: []
| }
[CI-CD/Installing Node 12 and required project packages    ]   ❌  Failure - actions/setup-node@v1
Error: exit with `FAILURE`: 1

Issue is stale and will be closed in 7 days unless there is new activity

I’m receiving this error as well running Windows 10 with Docker and WSL2. I’m trying to run act with the github-actions-demo project.

no I literally gave up after trying to get act to actually work properly for several hours today. I’ll just spent GA minutes on iterating on a script in a live repo instead. Good idea for a tool, but just nowhere near where it needs to be in order to make life easier, rather than harder.

I will try running on wsl and see how it works, but this bug is really an annoying one.

So one thing to bear in mind: windows has had support for the / path delimiter since literally before it was Windows; the only consideration is that you need to use double-quote paths with special characters. So sanitizing by using \/ is actually a really bad idea and will more often than not outright break things.

Did you find a workaround? having the same problem right now.