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.
$ 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.
npm install -D eslint
# in CI, run via npm script or npx (resolves node_modules/.bin):
npx eslint . # or: npm run lintKeep dev dependencies for the lint step
- Do not pass
--omit=dev/--productionto the install before linting. - Define a
"lint": "eslint ."npm script so it resolvesnode_modules/.bin/eslint. - Use
npm ci(with dev deps) so the binary is present.
How to prevent it
- Declare ESLint in
devDependenciesand run it via an npm script ornpx. - Keep dev dependencies installed for the lint step in CI.
- Never rely on a global ESLint install in CI.