electron-builder "ENOENT ... fpm" building deb/rpm in CI
electron-builder uses fpm to assemble Linux deb and rpm packages. "Exit code: ENOENT" while running fpm means the fpm binary, or the Ruby it needs, could not be launched on the runner.
What this error means
A --linux deb or rpm build fails with "Error: Exit code: ENOENT. Command failed: ... fpm ..." and a stack pointing at electron-builder's fpm target.
⨯ Exit code: ENOENT. spawn .../fpm ENOENT
command=deb
execName=fpmCommon causes
fpm or its Ruby runtime is absent
The deb/rpm target shells out to fpm; on a slim Linux runner the binary (or the ruby that backs it) is not installed.
A pruned electron-builder cache
electron-builder caches fpm under ~/.cache/electron-builder; if the cache is partial the spawn finds nothing.
How to fix it
Install fpm prerequisites
Provide Ruby and the packaging tools fpm needs for deb and rpm.
sudo apt-get update
sudo apt-get install -y ruby ruby-dev build-essential rpm
sudo gem install --no-document fpmBuild in the official Linux image
electronuserland/builder ships fpm and rpm, avoiding the ENOENT entirely.
docker run --rm -v ${PWD}:/project electronuserland/builder \
/bin/bash -c "npm ci && npx electron-builder --linux deb rpm"How to prevent it
- Install Ruby and rpm before building deb/rpm targets.
- Use the electronuserland/builder image for Linux packaging.
- Cache
~/.cache/electron-builderso fpm persists.