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.
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.
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.
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
...
Issue is stale and will be closed in 7 days unless there is new activity
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
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.
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.
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.
no I literally gave up after trying to get
actto 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.
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.
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 receiving this error as well running Windows 10 with Docker and WSL2. I'm trying to run act with the github-actions-demo project.
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.
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.)
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
any solution
Issue is stale and will be closed in 7 days unless there is new activity
Most helpful comment
Docker Desktop is running Linux containers in my case.