forked from tapio/live-server
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Trying to run alive-server from a container using podman on Windows throws an error.
Steps to reproduce
- Install podman on Windows. For instance:
winget install --id RedHat.Podman. - Run a container with podman in interactive mode with a shell:
podman run --entrypoint /bin/sh -it node:22.13.1. - At this point you should be in a shell in the container. Run
alive-server:mkdir /test && cd /test && npx --yes alive-server. - You get an error.
Expected behavior
After step 3 what you should see is
Serving "/test" at http://127.0.0.1:8080
Ready for changes
Actual behavior
This is the error you get:
Serving "/test" at http://127.0.0.1:8080
node:events:502
throw er; // Unhandled 'error' event
^
Error: spawn /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:285:19)
at onErrorNT (node:internal/child_process:483:16)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:291:12)
at onErrorNT (node:internal/child_process:483:16)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe',
path: '/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe',
spawnargs: [
'-NoProfile',
'-NonInteractive',
'–ExecutionPolicy',
'Bypass',
'-EncodedCommand',
'UwB0AGEAcgB0ACAAIgBoAHQAdABwADoALwAvADEAMgA3AC4AMAAuADAALgAxADoAOAAwADgAMAAiAA=='
]
}
Node.js v22.13.1
Additional context
This only happens with podman, I've tried both rancher and docker desktop and those work fine.
I believe this is the same problem as I reported in microsoft/playwright#34737. In that issue I described some research I did a suggestion that the problem might be related with the is-wsl dependency of the open package, which alive-server also uses.
As with the reported issue, alive-server is also using version 8 of the open package where the latest version available is 10. In the Playwright issue above it seems that indeed updating the package solved the problem.
Metadata
Metadata
Assignees
Labels
No labels