[GH-ISSUE #331] MODULE_NOT_FOUND on Windows 10 with Linux Containers #232

Closed
opened 2026-03-01 21:41:39 +03:00 by kerem · 10 comments
Owner

Originally created by @ColinM9991 on GitHub (Aug 4, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/331

Copied from here

I am developing on a Windows environment and building in a Linux container for docker, this is what I receive when running act.

act has been installed via Chocolatey, and also directly from the latest release.

[34m[CI Build - Master/build] [0m Run Setup .NET Core
[34m[CI Build - Master/build] [0m ☁ git clone 'https://github.com/actions/setup-dotnet' # ref=v1
[34m[CI Build - Master/build] [0m 🐳 docker cp src=act/actions-setup-dotnet@v1 dst=/actions
[34m|[0m internal/modules/cjs/loader.js:628
[34m|[0m throw err;
[34m|[0m ^
[34m|[0m
[34m|[0m Error: Cannot find module '/github/workspace/\actions\actions-setup-dotnet@v1\dist\index.js'
[34m|[0m [90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)[39m
[34m|[0m [90m at Function.Module._load (internal/modules/cjs/loader.js:527:27)[39m
[34m|[0m [90m at Function.Module.runMain (internal/modules/cjs/loader.js:839:10)[39m
[34m|[0m [90m at internal/main/run_main_module.js:17:11[39m {
[34m|[0m code: [32m'MODULE_NOT_FOUND'[39m,
[34m|[0m requireStack: []
[34m|[0m }
[34m[CI Build - Master/build] [0m Failure - Setup .NET Core
Error: exit with FAILURE: 1

Originally created by @ColinM9991 on GitHub (Aug 4, 2020). Original GitHub issue: https://github.com/nektos/act/issues/331 Copied from [here](https://github.com/nektos/act/issues/228#issuecomment-657067980) I am developing on a Windows environment and building in a Linux container for docker, this is what I receive when running `act`. act has been installed via Chocolatey, and also directly from the latest release. >[34m[CI Build - Master/build] [0m⭐ Run Setup .NET Core [34m[CI Build - Master/build] [0m ☁ git clone 'https://github.com/actions/setup-dotnet' # ref=v1 [34m[CI Build - Master/build] [0m 🐳 docker cp src=act/actions-setup-dotnet@v1 dst=/actions\ [34m|[0m internal/modules/cjs/loader.js:628 [34m|[0m throw err; [34m|[0m ^ [34m|[0m [34m|[0m Error: Cannot find module '/github/workspace/\actions\actions-setup-dotnet@v1\dist\index.js' [34m|[0m [90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)[39m [34m|[0m [90m at Function.Module._load (internal/modules/cjs/loader.js:527:27)[39m [34m|[0m [90m at Function.Module.runMain (internal/modules/cjs/loader.js:839:10)[39m [34m|[0m [90m at internal/main/run_main_module.js:17:11[39m { [34m|[0m code: [32m'MODULE_NOT_FOUND'[39m, [34m|[0m requireStack: [] [34m|[0m } [34m[CI Build - Master/build] [0m ❌ Failure - Setup .NET Core Error: exit with `FAILURE`: 1
kerem closed this issue 2026-03-01 21:41:39 +03:00
Author
Owner

@archon810 commented on GitHub (Aug 9, 2020):

Same problem here.

C:\Users\Artem Russakovskii\workspace\app>act
←[34m[Android CI/Lint and Build] ←[0m🚀  Start image=node:12.6-buster-slim
←[34m[Android CI/Lint and Build] ←[0m  🐳  docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
←[34m[Android CI/Lint and Build] ←[0m  🐳  docker cp src=C:\Users\Artem Russakovskii\workspace\app/. dst=\github\workspace
←[34m[Android CI/Lint and Build] ←[0m⭐  Run actions/checkout@v1
←[34m[Android CI/Lint and Build] ←[0m  ✅  Success - actions/checkout@v1
←[34m[Android CI/Lint and Build] ←[0m⭐  Run Setup JDK 1.8
←[34m[Android CI/Lint and Build] ←[0m  ☁  git clone 'https://github.com/actions/setup-java' # ref=v1
←[34m[Android CI/Lint and Build] ←[0m  🐳  docker cp src=act/actions-setup-java@v1 dst=/actions\
←[34m|←[0m internal/modules/cjs/loader.js:628
←[34m|←[0m     throw err;
←[34m|←[0m     ^
←[34m|←[0m
←[34m|←[0m Error: Cannot find module '/github/workspace/\actions\actions-setup-java@v1\dist\setup\index.js'
←[34m|←[0m ←[90m    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)←[39m
←[34m|←[0m ←[90m    at Function.Module._load (internal/modules/cjs/loader.js:527:27)←[39m
←[34m|←[0m ←[90m    at Function.Module.runMain (internal/modules/cjs/loader.js:839:10)←[39m
←[34m|←[0m ←[90m    at internal/main/run_main_module.js:17:11←[39m {
←[34m|←[0m   code: ←[32m'MODULE_NOT_FOUND'←[39m,
←[34m|←[0m   requireStack: []
←[34m|←[0m }
←[34m[Android CI/Lint and Build] ←[0m  ❌  Failure - Setup JDK 1.8
Error: exit with `FAILURE`: 1
<!-- gh-comment-id:671017582 --> @archon810 commented on GitHub (Aug 9, 2020): Same problem here. ``` C:\Users\Artem Russakovskii\workspace\app>act ←[34m[Android CI/Lint and Build] ←[0m🚀 Start image=node:12.6-buster-slim ←[34m[Android CI/Lint and Build] ←[0m 🐳 docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] ←[34m[Android CI/Lint and Build] ←[0m 🐳 docker cp src=C:\Users\Artem Russakovskii\workspace\app/. dst=\github\workspace ←[34m[Android CI/Lint and Build] ←[0m⭐ Run actions/checkout@v1 ←[34m[Android CI/Lint and Build] ←[0m ✅ Success - actions/checkout@v1 ←[34m[Android CI/Lint and Build] ←[0m⭐ Run Setup JDK 1.8 ←[34m[Android CI/Lint and Build] ←[0m ☁ git clone 'https://github.com/actions/setup-java' # ref=v1 ←[34m[Android CI/Lint and Build] ←[0m 🐳 docker cp src=act/actions-setup-java@v1 dst=/actions\ ←[34m|←[0m internal/modules/cjs/loader.js:628 ←[34m|←[0m throw err; ←[34m|←[0m ^ ←[34m|←[0m ←[34m|←[0m Error: Cannot find module '/github/workspace/\actions\actions-setup-java@v1\dist\setup\index.js' ←[34m|←[0m ←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)←[39m ←[34m|←[0m ←[90m at Function.Module._load (internal/modules/cjs/loader.js:527:27)←[39m ←[34m|←[0m ←[90m at Function.Module.runMain (internal/modules/cjs/loader.js:839:10)←[39m ←[34m|←[0m ←[90m at internal/main/run_main_module.js:17:11←[39m { ←[34m|←[0m code: ←[32m'MODULE_NOT_FOUND'←[39m, ←[34m|←[0m requireStack: [] ←[34m|←[0m } ←[34m[Android CI/Lint and Build] ←[0m ❌ Failure - Setup JDK 1.8 Error: exit with `FAILURE`: 1 ```
Author
Owner

@franTarkenton commented on GitHub (Aug 20, 2020):

Ditto:

[BUILD Package/Build BCDC-SMK container image          ] �  Start image=node:12.6-buster-slim
[BUILD Package/Build BCDC-SMK container image          ]   �  docker run image=node:12.6-buster-slim entrypoint=["/usr/b in/tail" "-f" "/dev/null"] cmd=[]
[BUILD Package/Build BCDC-SMK container image          ] ⭐  Run actions/checkout@v2
[BUILD Package/Build BCDC-SMK container image          ]   ☁  git clone 'https://github.com/actions/checkout' # ref=v2
[BUILD Package/Build BCDC-SMK container image          ]   �  docker cp src=act/actions-checkout@v2 dst=/actions\
| internal/modules/cjs/loader.js:628
|     throw err;
|     ^
|
| Error: Cannot find module '/github/workspace/\actions\actions-checkout@v2\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: []
| }
[BUILD Package/Build BCDC-SMK container image          ]   ❌  Failure - actions/checkout@v2
Error: exit with `FAILURE`: 1
<!-- gh-comment-id:677785961 --> @franTarkenton commented on GitHub (Aug 20, 2020): Ditto: ``` [BUILD Package/Build BCDC-SMK container image ] � Start image=node:12.6-buster-slim [BUILD Package/Build BCDC-SMK container image ] � docker run image=node:12.6-buster-slim entrypoint=["/usr/b in/tail" "-f" "/dev/null"] cmd=[] [BUILD Package/Build BCDC-SMK container image ] ⭐ Run actions/checkout@v2 [BUILD Package/Build BCDC-SMK container image ] ☁ git clone 'https://github.com/actions/checkout' # ref=v2 [BUILD Package/Build BCDC-SMK container image ] � docker cp src=act/actions-checkout@v2 dst=/actions\ | internal/modules/cjs/loader.js:628 | throw err; | ^ | | Error: Cannot find module '/github/workspace/\actions\actions-checkout@v2\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: [] | } [BUILD Package/Build BCDC-SMK container image ] ❌ Failure - actions/checkout@v2 Error: exit with `FAILURE`: 1 ```
Author
Owner

@franTarkenton commented on GitHub (Aug 20, 2020):

This issue went away for me when I commented out the ref property in the checkout step:

   ...
    runs-on: ubuntu-18.04
    steps:
    - uses: actions/checkout@v2
      id: checkout
      with:
        # ----- comment out ref seems to resolve this issue for me
        #ref: v2
        fetch-depth: 0

<!-- gh-comment-id:677810532 --> @franTarkenton commented on GitHub (Aug 20, 2020): This issue went away for me when I commented out the `ref` property in the checkout step: ``` ... runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 id: checkout with: # ----- comment out ref seems to resolve this issue for me #ref: v2 fetch-depth: 0 ```
Author
Owner

@timheuer commented on GitHub (Aug 20, 2020):

Does not resolve for me:

❯ act
[Build and Deploy/Build and Deploy] 🚀 Start image=node:12.6-buster-slim
[Build and Deploy/Build and Deploy] 🐳 docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Build and Deploy/Build and Deploy] 🐳 docker cp src=C:\Users\timheuer\Documents\GitHub\aspnet-core-sample-deploy/. dst=\github\workspace
[Build and Deploy/Build and Deploy] Run actions/checkout@v2
[Build and Deploy/Build and Deploy] Success - actions/checkout@v2
[Build and Deploy/Build and Deploy] Run Setup .NET Core SDK ${{ env.NETCORE_VERSION }}
[Build and Deploy/Build and Deploy] ☁ git clone 'https://github.com/actions/setup-dotnet' # ref=v1
[Build and Deploy/Build and Deploy] 🐳 docker cp src=C:\Users\timheuer.cache\act/actions-setup-dotnet@v1 dst=/actions
| internal/modules/cjs/loader.js:628
| throw err;
| ^
|
| Error: Cannot find module '/github/workspace/\actions\actions-setup-dotnet@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: []
| }
[Build and Deploy/Build and Deploy] Failure - Setup .NET Core SDK ${{ env.NETCORE_VERSION }}
Error: exit with FAILURE: 1

<!-- gh-comment-id:677813813 --> @timheuer commented on GitHub (Aug 20, 2020): Does not resolve for me: >❯ act [Build and Deploy/Build and Deploy] 🚀 Start image=node:12.6-buster-slim [Build and Deploy/Build and Deploy] 🐳 docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Build and Deploy/Build and Deploy] 🐳 docker cp src=C:\Users\timheuer\Documents\GitHub\aspnet-core-sample-deploy/. dst=\github\workspace [Build and Deploy/Build and Deploy] ⭐ Run actions/checkout@v2 [Build and Deploy/Build and Deploy] ✅ Success - actions/checkout@v2 [Build and Deploy/Build and Deploy] ⭐ Run Setup .NET Core SDK ${{ env.NETCORE_VERSION }} [Build and Deploy/Build and Deploy] ☁ git clone 'https://github.com/actions/setup-dotnet' # ref=v1 [Build and Deploy/Build and Deploy] 🐳 docker cp src=C:\Users\timheuer\.cache\act/actions-setup-dotnet@v1 dst=/actions\ | internal/modules/cjs/loader.js:628 | throw err; | ^ | | Error: Cannot find module '/github/workspace/\actions\actions-setup-dotnet@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: [] | } [Build and Deploy/Build and Deploy] ❌ Failure - Setup .NET Core SDK ${{ env.NETCORE_VERSION }} Error: exit with `FAILURE`: 1
Author
Owner

@cdelgadob commented on GitHub (Aug 24, 2020):

I'm trying to launch the Azure Login sample, with this definition:

on: [push]

name: AzureLoginSample

jobs:

  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
    
    - uses: azure/login@v1.1
      with:
        creds: ${{ secrets.AZURE_CREDENTIALS }}
    
    - run: |
        az webapp list --query "[?state=='Running']"

But I get the MODULE_NOT_FOUND error:

[AzureLoginSample/build-and-deploy] 🚀  Start image=node:12.6-buster-slim
[AzureLoginSample/build-and-deploy]   🐳  docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[AzureLoginSample/build-and-deploy] ⭐  Run azure/login@v1.1
[AzureLoginSample/build-and-deploy]   ☁  git clone 'https://github.com/azure/login' # ref=v1.1
[AzureLoginSample/build-and-deploy]   🐳  docker cp src=act/azure-login@v1.1 dst=/actions\
| internal/modules/cjs/loader.js:628
|     throw err;
|     ^
|
| Error: Cannot find module '/github/workspace/\actions\azure-login@v1.1\lib\main.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: []
| }
[AzureLoginSample/build-and-deploy]   ❌  Failure - azure/login@v1.1
Error: exit with `FAILURE`: 1

I'm using Windows 10, and the WSL is version 2:

wsl -l -v
 NAME                   STATE           VERSION
* Ubuntu-20.04           Running         2
  docker-desktop-data    Running         2
  docker-desktop         Running         2
<!-- gh-comment-id:678984761 --> @cdelgadob commented on GitHub (Aug 24, 2020): I'm trying to launch the Azure Login sample, with this definition: ``` on: [push] name: AzureLoginSample jobs: build-and-deploy: runs-on: ubuntu-latest steps: - uses: azure/login@v1.1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} - run: | az webapp list --query "[?state=='Running']" ``` But I get the MODULE_NOT_FOUND error: ``` [AzureLoginSample/build-and-deploy] 🚀 Start image=node:12.6-buster-slim [AzureLoginSample/build-and-deploy] 🐳 docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [AzureLoginSample/build-and-deploy] ⭐ Run azure/login@v1.1 [AzureLoginSample/build-and-deploy] ☁ git clone 'https://github.com/azure/login' # ref=v1.1 [AzureLoginSample/build-and-deploy] 🐳 docker cp src=act/azure-login@v1.1 dst=/actions\ | internal/modules/cjs/loader.js:628 | throw err; | ^ | | Error: Cannot find module '/github/workspace/\actions\azure-login@v1.1\lib\main.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: [] | } [AzureLoginSample/build-and-deploy] ❌ Failure - azure/login@v1.1 Error: exit with `FAILURE`: 1 ``` I'm using Windows 10, and the WSL is version 2: ``` wsl -l -v NAME STATE VERSION * Ubuntu-20.04 Running 2 docker-desktop-data Running 2 docker-desktop Running 2 ```
Author
Owner

@matfax commented on GitHub (Aug 24, 2020):

It might be a path related issue.
docker cp src=act/arbitrary-linux-image@master dst=/actions\
Here, the dst will be run in a Linux environment. Linux might confuse the \ at the end.

<!-- gh-comment-id:679056870 --> @matfax commented on GitHub (Aug 24, 2020): It might be a path related issue. `docker cp src=act/arbitrary-linux-image@master dst=/actions\` Here, the dst will be run in a Linux environment. Linux might confuse the `\` at the end.
Author
Owner

@cdelgadob commented on GitHub (Aug 24, 2020):

That's what I think as well, because when I run act in the same machine
but from Linux, it works.

This line doesn't look good neither: /github/workspace/\actions\azure-login@v1.1\lib\main.js

<!-- gh-comment-id:679063304 --> @cdelgadob commented on GitHub (Aug 24, 2020): That's what I think as well, because when I run ```act``` in the same machine but from Linux, it works. This line doesn't look good neither: ```/github/workspace/\actions\azure-login@v1.1\lib\main.js```
Author
Owner

@timheuer commented on GitHub (Aug 24, 2020):

Agreed, need to convert posix paths

<!-- gh-comment-id:679184292 --> @timheuer commented on GitHub (Aug 24, 2020): Agreed, need to convert posix paths
Author
Owner

@akhilmhdh commented on GitHub (Sep 6, 2020):

Hey guys, will this be fixed soon, or is there any work around to this in win 10. Stuck on this for a while : (

<!-- gh-comment-id:687711253 --> @akhilmhdh commented on GitHub (Sep 6, 2020): Hey guys, will this be fixed soon, or is there any work around to this in win 10. Stuck on this for a while : (
Author
Owner

@matfax commented on GitHub (Sep 13, 2020):

The workaround is using Ubuntu 20+WSL2 on Win 10, installing Docker, enabling WSL2 for docker, enabling WSL2 integration in docker to Ubuntu 20, and then using act from the Ubuntu environment.

<!-- gh-comment-id:691717349 --> @matfax commented on GitHub (Sep 13, 2020): The workaround is using Ubuntu 20+WSL2 on Win 10, installing Docker, enabling WSL2 for docker, enabling WSL2 integration in docker to Ubuntu 20, and then using act from the Ubuntu environment.
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#232
No description provided.