Skip to content
Latchkey

CI "eslint: command not found" - Fix Missing ESLint Binary

The shell could not find an eslint executable. ESLint is not installed in the project, dev dependencies were pruned, or the step invoked a bare eslint that only resolves to a global install which CI does not have.

What this error means

The lint step fails with eslint: command not found (or not found) and exit code 127. The same command works locally where ESLint is on PATH or installed.

shell
$ eslint .
/bin/sh: 1: eslint: command not found
Error: Process completed with exit code 127.

Common causes

ESLint not installed or dev deps pruned

ESLint is missing from devDependencies, or the install ran with --omit=dev/--production, so the binary is absent in CI.

Calling a bare global eslint

The step runs eslint directly, relying on a global install. CI has no global ESLint, so it must use the local binary via npx/an npm script.

How to fix it

Install ESLint and call it locally

Add ESLint as a dev dependency and invoke the project-local binary.

Terminal
npm install -D eslint
# in CI, run via npm script or npx (resolves node_modules/.bin):
npx eslint .   # or: npm run lint

Keep dev dependencies for the lint step

  1. Do not pass --omit=dev/--production to the install before linting.
  2. Define a "lint": "eslint ." npm script so it resolves node_modules/.bin/eslint.
  3. Use npm ci (with dev deps) so the binary is present.

How to prevent it

  • Declare ESLint in devDependencies and run it via an npm script or npx.
  • Keep dev dependencies installed for the lint step in CI.
  • Never rely on a global ESLint install in CI.

Related guides

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