Skip to content
Latchkey

Serverless Framework "spawn ... ENOENT" during packaging in CI

A Serverless plugin spawned a child process for packaging (often docker for serverless-python-requirements, or python/esbuild) and the executable was not found on PATH. Node reports ENOENT for the missing command.

What this error means

serverless deploy fails with "Error: spawn docker ENOENT" or "spawn python ENOENT" while a packaging plugin runs, even though deploy works on a developer machine that has the tool.

serverless
Error:
Error: spawn docker ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:...)
    at onErrorNT (node:internal/child_process:...)

Common causes

A required executable is missing on the runner

The plugin shells out to docker, python, or another binary that is not installed or not on PATH in CI.

Dockerized packaging without Docker

serverless-python-requirements with dockerizePip: true needs Docker; on a runner without it, the spawn fails.

How to fix it

Install the required tool, or disable dockerization

  1. If the plugin needs Docker, run on a runner that has it, or set dockerizePip: false.
  2. For python, ensure the interpreter is installed and on PATH.
  3. Re-run; the spawned command now resolves.
serverless.yml
custom:
  pythonRequirements:
    dockerizePip: false

Provide the toolchain in CI

Set up the interpreter the plugin spawns so PATH lookup succeeds.

.github/workflows/ci.yml
- uses: actions/setup-python@v5
  with:
    python-version: '3.12'

How to prevent it

  • Match the runner toolchain to what packaging plugins spawn.
  • Avoid dockerizePip on runners without Docker.
  • Pin plugin and tool versions for reproducible packaging.

Frequently asked questions

What causes ""spawn ... ENOENT""?
The plugin shells out to docker, python, or another binary that is not installed or not on PATH in CI.
How do I fix "spawn ... ENOENT"?
Install the required tool, or disable dockerization

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card