Skip to content
Latchkey

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.

electron-builder
  ⨯ Exit code: ENOENT. spawn .../fpm ENOENT
      command=deb
      execName=fpm

Common 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.

Terminal
sudo apt-get update
sudo apt-get install -y ruby ruby-dev build-essential rpm
sudo gem install --no-document fpm

Build in the official Linux image

electronuserland/builder ships fpm and rpm, avoiding the ENOENT entirely.

Terminal
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-builder so fpm persists.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →