ESLint cannot decide which copy of the @typescript-eslint plugin to use
ESLint couldn't determine the plugin "@typescript-eslint" uniquely.Short answer
ESLint found the same plugin at two different file paths and will not pick one. The error lists both paths and the config that loaded each. Either two copies are installed, for example one nested inside a shared config, or two config files load it from different folders. Make the path single, or set where plugins are resolved from.
Fix it fast
1Find out which cause you have
Read the paths in the error message. ESLint lists, for each copy it found, the file path and the name of the config that loaded it. Two different paths are the whole problem, and which two they are decides the cause: both under node_modules points at a duplicate install, one outside your project points at a stray config.
npx eslint src npm ls @typescript-eslint/eslint-plugin2Match what you see, then jump to its fix
- 1
Both paths in the error end in @typescript-eslint/eslint-plugin, one under your root node_modules and one nested under another package, often a shareable config.Two copies of the plugin are installedFix - 2
One of the two paths is outside the folder you are linting, for example in a home directory or the root of a monorepo, and the config that loaded it is not yours.A second .eslintrc in a parent folder loads the plugin from elsewhereFix - 3
One path is your project's node_modules and the other belongs to a config or tool that runs ESLint for you.A shared config and your config resolve plugins from different foldersFix
- 1
What does the error look like?
ESLint couldn't determine the plugin "@typescript-eslint" uniquely.The message lists two file paths for the same plugin, each with the name of the config that loaded it
Cause 1 of 3
Two copies of the plugin are installed
1Check
npm ls with a package name prints every path that leads to that package, nested ones included. More than one version or more than one location confirms it.
npm ls @typescript-eslint/eslint-plugin2Fix
Bring the versions into line so that one copy satisfies every dependent, then let npm move the shared copy up the tree. npm dedupe only simplifies the tree, it never installs new modules, and a dry run first shows what it would change.
npm dedupe --dry-run
npm dedupe3Verify
npm ls shows one location, and ESLint runs without the error.
npm ls @typescript-eslint/eslint-plugin
npx eslint srcConfirmed by docs.npmjs.com
Cause 2 of 3
A second .eslintrc in a parent folder loads the plugin from elsewhere
1Check
ESLint merges .eslintrc files from the folder of the file upward, until one sets root to true. Each config resolves its plugins from its own folder, so two configs can reach two different installs.
# configs above the project, up to the filesystem root
ls -a .. ../.. | grep -i eslintrc2Fix
Stop the search at your project by setting root in its config, or delete the stray config.
// .eslintrc.json in the project root
{
"root": true,
"plugins": ["@typescript-eslint"]
}3Verify
Run ESLint again. The plugin is now loaded from the project only, and the error is gone.
npx eslint srcConfirmed by eslint.org
Cause 3 of 3
A shared config and your config resolve plugins from different folders
1Check
By default ESLint resolves plugins from the folder of the config file that names them. The CLI option that changes the folder is meant for plugins installed by someone other than the end user, and the docs say to point it at the project that depends on the plugins.
grep -n "eslint" package.json2Fix
Run ESLint with every plugin resolved from the project folder.
npx eslint --resolve-plugins-relative-to . src3Verify
The same command now finishes without the plugin error.
npx eslint --resolve-plugins-relative-to . srcConfirmed by eslint.org
How do I stop it coming back?
- Keep one version range for @typescript-eslint/eslint-plugin and @typescript-eslint/parser in the project, and run npm dedupe after a major upgrade.
- Put root: true in the top .eslintrc of every project, so stray configs above it are not merged.
- Move to flat config (eslint.config.js): there plugins are imported objects, the root and plugin-path options no longer exist, and a config file acts as if root were set.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- WorkforceA field app, an admin console and a self-hosted Node.js server for push and reconciliation.
Related fixes
Web apps
ESLint cannot load the react plugin (eslint-plugin-react missing)
Failed to load plugin 'react' declared in '.eslintrc': Cannot find module 'eslint-plugin-react'
ESLint loads a plugin by name, as if the config file required eslint-plugin-react itself.
2 causes, each with a fixWeb apps
tsconfig rejects allowImportingTsExtensions
An error that allowImportingTsExtensions needs noEmit or emitDeclarationOnly
allowImportingTsExtensions lets files import each other with .ts or .tsx extensions, and TypeScript only allows it together with noEmit or emitDeclarationOnly.
2 causes, each with a fixWeb apps
Cypress refuses to start with 'Your configFile is invalid'
Your configFile threw an error from: /path/to/cypress.config.ts
Cypress could not load cypress.config.js or .ts, or found something wrong in it.
5 causes, each with a fixWeb apps
ESLint says it cannot resolve a path to a module that does exist
Unable to resolve path to module 'react'. import/no-unresolved
import/no-unresolved fails when eslint-plugin-import cannot find the file or package on disk with its resolver.
4 causes, each with a fixWeb apps
ESLint was configured to run using parserOptions.project, but the file is not in the TSConfig
However, that TSConfig does not include this file
Type-aware linting needs every linted file to belong to a TypeScript project.
4 causes, each with a fixWeb apps
Upgrading to Next.js 16: middleware becomes proxy, and the other things that break
Missing Required default.js for Parallel Route
Next.js 16 renames middleware.ts to proxy.ts and its exported function to proxy.
6 causes, each with a fix