Skip to content

[Bug] Cannot run alive-server using podman #12

@edumserrano

Description

@edumserrano

Trying to run alive-server from a container using podman on Windows throws an error.

Steps to reproduce

  1. Install podman on Windows. For instance: winget install --id RedHat.Podman.
  2. Run a container with podman in interactive mode with a shell: podman run --entrypoint /bin/sh -it node:22.13.1.
  3. At this point you should be in a shell in the container. Run alive-server: mkdir /test && cd /test && npx --yes alive-server .
  4. 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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions