ESLint "Parsing error: Cannot find module '@typescript-eslint/parser'" in CI
Your ESLint config sets parser: "@typescript-eslint/parser", but that package is not installed in the CI environment, so ESLint cannot parse any .ts file and reports a parsing error.
What this error means
Every TypeScript file fails with "Parsing error: Cannot find module '@typescript-eslint/parser'" and the lint step exits non-zero, while JS files lint fine.
ESLint
/home/runner/work/app/app/src/index.ts
0:0 error Parsing error: Cannot find module '@typescript-eslint/parser'
Require stack:
- /home/runner/work/app/app/node_modules/...Common causes
The parser package is not installed
The config references @typescript-eslint/parser, but it is missing from package.json so a clean install on the runner never provisions it.
Dev dependencies were omitted in CI
A production-only install pruned the parser and the @typescript-eslint plugin, which are dev dependencies.
How to fix it
Install the parser and plugin
- Add
@typescript-eslint/parserand@typescript-eslint/eslint-pluginto devDependencies. - Commit the lockfile.
- Install dev dependencies in the lint job.
Terminal
npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-pluginKeep the install in the lint job
Run a full install (not production-only) before ESLint.
.github/workflows/ci.yml
- run: npm ci
- run: npx eslint . --ext .ts,.tsxHow to prevent it
- List the parser and plugin in devDependencies and the lockfile.
- Avoid
--omit=devin jobs that run ESLint. - Pin parser and plugin versions together to avoid peer mismatches.
Related guides
ESLint "Could not find config" to extend in CIFix ESLint "Cannot find module 'eslint-config-X'" / "Failed to load config X to extend from" in CI - a sharea…
ESLint "Definition for rule was not found" in CIFix ESLint "Definition for rule X was not found" in CI - your config references a rule whose plugin is missin…
ESLint "couldn't find an eslint.config file" (flat config) in CIFix ESLint v9 "ESLint couldn't find an eslint.config.(js|mjs|cjs) file" in CI - v9 defaults to flat config an…