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.
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
- If the plugin needs Docker, run on a runner that has it, or set
dockerizePip: false. - For
python, ensure the interpreter is installed and on PATH. - Re-run; the spawned command now resolves.
custom:
pythonRequirements:
dockerizePip: falseProvide the toolchain in CI
Set up the interpreter the plugin spawns so PATH lookup succeeds.
- uses: actions/setup-python@v5
with:
python-version: '3.12'How to prevent it
- Match the runner toolchain to what packaging plugins spawn.
- Avoid
dockerizePipon runners without Docker. - Pin plugin and tool versions for reproducible packaging.