[GH-ISSUE #145] Seemingly invalid path separator on Windows using actions/setup-node #95

Closed
opened 2026-03-01 21:40:03 +03:00 by kerem · 18 comments
Owner

Originally created by @Swiftwork on GitHub (Mar 11, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/145

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.

Originally created by @Swiftwork on GitHub (Mar 11, 2020). Original GitHub issue: https://github.com/nektos/act/issues/145 Running command ```powershell act -P ubuntu-latest=nektos/act-environments-ubuntu:18.04 ``` on `Microsoft Windows 10 Pro Build 10.0.18363` using `release v0.2.6` ```yaml - name: Set up Node.js version 13.x uses: actions/setup-node@v1 with: node-version: 13.x ``` results in ```powershell [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](https://github.com/nektos/act) or [actions/setup-node](https://github.com/actions/setup-node). If you can't reproduce the issue it occurs currently with [trutoo/event-bus](https://github.com/trutoo/event-bus). It does however work in in my WSL.
Author
Owner

@cplee commented on GitHub (Mar 11, 2020):

This looks like a bug with act. In an effort to support windows, i overdid the use of filepath.Join() and filepath.Separator. These create paths that are windows specific and are then fed in to the linux container 🤦‍♂️

All the places that use those need to be reviewed to determine if the path is used on the host or within the container. The ones in the container should all use / explicitly.

<!-- gh-comment-id:597713896 --> @cplee commented on GitHub (Mar 11, 2020): This looks like a bug with `act`. In an effort to support windows, i overdid the use of `filepath.Join()` and `filepath.Separator`. These create paths that are windows specific and are then fed in to the linux container 🤦‍♂️ All the places that use those need to be reviewed to determine if the path is used on the host or within the container. The ones in the container should all use `/` explicitly.
Author
Owner

@aslafy-z commented on GitHub (Mar 11, 2020):

This behavior has to be specific to Linux containers. In windows containers, path separator has to match the windows path separator (\). I've seen that windows runners aren't supported in act from now so it may not be a priority but it guess it can be implemented in a adaptable way for the future.

<!-- gh-comment-id:597777566 --> @aslafy-z commented on GitHub (Mar 11, 2020): This behavior has to be specific to Linux containers. In windows containers, path separator has to match the windows path separator (`\`). I've seen that windows runners aren't supported in act from now so it may not be a priority but it guess it can be implemented in a adaptable way for the future.
Author
Owner

@ArwynFr commented on GitHub (Apr 4, 2020):

Workspace volume mount is impacted as well.
Instead of creating a hierarchic directory, all files are flattened in the same directory :

[integration/build]   �🐳  docker run image=arwynfr/armake2:alpine entrypoint=["ls"] cmd=["-l" "/github/workspace/"]
| total 1932
| -rw-rw-rw-    1 root     root          1082 Mar 23 22:12 LICENSE
| drwxr-xr-x    2 root     root          4096 Apr  4 02:50 \github\workspace
| -rw-rw-rw-    1 root     root          1403 Mar 23 22:49 addons\gsri_opex\CfgNotifications.hpp
| -rw-rw-rw-    1 root     root          8320 Apr  4 02:44 addons\gsri_opex\Stringtable.xml
| -rw-rw-rw-    1 root     root          2610 Apr  4 02:44 addons\gsri_opex\config.cpp
| -rw-rw-rw-    1 root     root           633 Mar 23 22:12 addons\gsri_opex\functions\bays\fn_bayReplace.sqf
...
`
<!-- gh-comment-id:608966240 --> @ArwynFr commented on GitHub (Apr 4, 2020): Workspace volume mount is impacted as well. Instead of creating a hierarchic directory, all files are flattened in the same directory : ``` [integration/build] �🐳 docker run image=arwynfr/armake2:alpine entrypoint=["ls"] cmd=["-l" "/github/workspace/"] | total 1932 | -rw-rw-rw- 1 root root 1082 Mar 23 22:12 LICENSE | drwxr-xr-x 2 root root 4096 Apr 4 02:50 \github\workspace | -rw-rw-rw- 1 root root 1403 Mar 23 22:49 addons\gsri_opex\CfgNotifications.hpp | -rw-rw-rw- 1 root root 8320 Apr 4 02:44 addons\gsri_opex\Stringtable.xml | -rw-rw-rw- 1 root root 2610 Apr 4 02:44 addons\gsri_opex\config.cpp | -rw-rw-rw- 1 root root 633 Mar 23 22:12 addons\gsri_opex\functions\bays\fn_bayReplace.sqf ... `
Author
Owner

@github-actions[bot] commented on GitHub (Jun 4, 2020):

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

<!-- gh-comment-id:638525032 --> @github-actions[bot] commented on GitHub (Jun 4, 2020): Issue is stale and will be closed in 7 days unless there is new activity
Author
Owner

@Pomax commented on GitHub (Jun 7, 2020):

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
<!-- gh-comment-id:640252073 --> @Pomax commented on GitHub (Jun 7, 2020): 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 ```
Author
Owner

@Pomax commented on GitHub (Jun 7, 2020):

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.

<!-- gh-comment-id:640252352 --> @Pomax commented on GitHub (Jun 7, 2020): 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.
Author
Owner

@fenilli commented on GitHub (Jun 7, 2020):

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.

<!-- gh-comment-id:640279572 --> @fenilli commented on GitHub (Jun 7, 2020): > 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.
Author
Owner

@Pomax commented on GitHub (Jun 8, 2020):

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.

<!-- gh-comment-id:640319727 --> @Pomax commented on GitHub (Jun 8, 2020): 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.
Author
Owner

@fenilli commented on GitHub (Jun 8, 2020):

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.

<!-- gh-comment-id:640690616 --> @fenilli commented on GitHub (Jun 8, 2020): > 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.
Author
Owner

@fenilli commented on GitHub (Jun 9, 2020):

As a workaround to this bug, you can use WSL2.

By installing windows 10 update 2004, and enabling wsl, updating the kernel to wsl 2, installing docker and enabling to use wsl2, then running the command act will work properly without invalid path separator.

<!-- gh-comment-id:641565431 --> @fenilli commented on GitHub (Jun 9, 2020): As a workaround to this bug, you can use WSL2. By installing windows 10 update 2004, and enabling wsl, updating the kernel to wsl 2, installing docker and enabling to use wsl2, then running the command act will work properly without invalid path separator.
Author
Owner

@DUG-nick commented on GitHub (Jul 16, 2020):

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 :(

<!-- gh-comment-id:659361403 --> @DUG-nick commented on GitHub (Jul 16, 2020): 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 :(
Author
Owner

@Splode commented on GitHub (Jul 25, 2020):

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.

<!-- gh-comment-id:663896806 --> @Splode commented on GitHub (Jul 25, 2020): 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.
Author
Owner

@satyaki1 commented on GitHub (Jul 29, 2020):

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.

<!-- gh-comment-id:665568619 --> @satyaki1 commented on GitHub (Jul 29, 2020): 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.
Author
Owner

@Splode commented on GitHub (Jul 30, 2020):

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.

<!-- gh-comment-id:666001544 --> @Splode commented on GitHub (Jul 30, 2020): > 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.
Author
Owner

@Komposten commented on GitHub (Jul 30, 2020):

Ran act successfully using WSL 1 today, with Docker for Windows set to Linux containers.

Running it straight on Windows (using CMD, Git Bash, or similar) does not work. (In my case it was the cedx/setup-dart action rather than actions/setup-node.)

<!-- gh-comment-id:666008784 --> @Komposten commented on GitHub (Jul 30, 2020): Ran act successfully using WSL 1 today, with Docker for Windows set to Linux containers. Running it straight on Windows (using CMD, Git Bash, or similar) does not work. (In my case it was the cedx/setup-dart action rather than actions/setup-node.)
Author
Owner

@satyaki1 commented on GitHub (Jul 30, 2020):

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.

You may try adding to your environment path COMPOSE_CONVERT_WINDOWS_PATHS 0 or 1 as per your need, and run again. FYI

<!-- gh-comment-id:666068557 --> @satyaki1 commented on GitHub (Jul 30, 2020): > > 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. You may try adding to your environment path `COMPOSE_CONVERT_WINDOWS_PATHS` 0 or 1 as per your need, and run again. [FYI](https://docs.docker.com/compose/reference/envvars/#compose_convert_windows_paths)
Author
Owner

@terabytesoftw commented on GitHub (Aug 19, 2020):

any solution

<!-- gh-comment-id:676545963 --> @terabytesoftw commented on GitHub (Aug 19, 2020): any solution
Author
Owner

@github-actions[bot] commented on GitHub (Oct 19, 2020):

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

<!-- gh-comment-id:711449218 --> @github-actions[bot] commented on GitHub (Oct 19, 2020): Issue is stale and will be closed in 7 days unless there is new activity
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#95
No description provided.