Skip to content
Latchkey

ESLint "Cannot find module '@typescript-eslint/parser'"

ESLint's config sets parser: '@typescript-eslint/parser' (directly or via a shareable config), but the parser package is not installed. ESLint cannot parse a single file without it, so every file errors.

What this error means

ESLint fails with Parsing error: Cannot find module '@typescript-eslint/parser' (often "Require stack" beneath it). Nothing lints because the parser cannot load.

eslint
/app/src/index.ts
  0:0  error  Parsing error: Cannot find module '@typescript-eslint/parser'
Require stack:
- /app/node_modules/@eslint/eslintrc/dist/eslintrc.cjs

Common causes

Parser package not installed

The config names @typescript-eslint/parser but it is missing from package.json, or a clean npm ci did not install it (only present locally before).

Pulled in transitively, not declared

The parser appeared only as a transitive dependency of a shareable config; when hoisting changes, the direct reference can no longer resolve it.

How to fix it

Install the parser (and the plugin) as dev deps

Terminal
npm install -D @typescript-eslint/parser @typescript-eslint/eslint-plugin
# flat config: npm install -D typescript-eslint

Declare every config dependency directly

  1. List @typescript-eslint/parser (and @typescript-eslint/eslint-plugin) in devDependencies.
  2. Do not rely on a shareable config to provide a parser you reference directly.
  3. Install with npm ci so CI matches the lockfile exactly.

How to prevent it

  • Declare the ESLint parser and TypeScript plugin in devDependencies.
  • Install with npm ci for reproducible lint dependencies.
  • Avoid relying on transitive hoisting for the parser.

Related guides

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