Fix typescript-eslint ERESOLVE After Upgrading to TypeScript 7
You bump typescript to 7.0.2, or a Renovate PR does it for you, and npm install stops with ERESOLVE, pointing at peer typescript@">=4.8.4 <6.1.0" from typescript-eslint@8.72.1. You retry with --legacy-peer-deps, the install goes green, and ESLint dies at startup with typescript-eslint does not support TS 7.0. Nothing is wrong with your code. typescript-eslint needs a compiler API that TypeScript 7 doesn't have yet, so I set up both compilers side by side on Node 25 and recorded what broke along the way.
Keep the TypeScript 6 API under the name typescript and install TypeScript 7 under another name. In devDependencies, set "typescript": "npm:@typescript/typescript6@^6.0.2" and "@typescript/native": "npm:typescript@^7.0.2". npm install and npm ci then pass with no flags, npx tsc runs 7.0.2, and ESLint's typed rules run on the 6.x API. Skip --legacy-peer-deps: it only moves the failure to ESLint startup.
The npm alias setup that keeps typescript-eslint working on TypeScript 7
Two npm aliases do the job, and they're Microsoft's own recommendation. The TypeScript 7.0 announcement names this exact case: "Because some tools like typescript-eslint expect to import from typescript directly via peer dependencies, we recommend achieving this via npm aliases." Here's the package.json from my test project:
{
"name": "c-alias",
"private": true,
"type": "module",
"scripts": {
"lint": "eslint src",
"typecheck": "tsc --noEmit",
"typecheck:6": "tsc6 --noEmit"
},
"devDependencies": {
"@typescript/native": "npm:typescript@^7.0.2",
"eslint": "10.14.0",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"typescript-eslint": "8.72.1"
}
}
The key on the left does the work. typescript-eslint imports typescript and declares a peer on it, so the TS 6 package has to sit at exactly that name. TS 7 can live anywhere else, and I used @typescript/native because that's the name in the official post.
| Name in package.json | What lands on disk | Who uses it |
|---|---|---|
typescript | @typescript/typescript6 6.0.2, whose dependency brings in the real 6.0.3 compiler | typescript-eslint, npx tsc6 |
@typescript/native | typescript 7.0.2 | npx tsc, your typecheck script |
Delete node_modules, reinstall, then check which compiler answers to which name:
rm -rf node_modules
npm install
npx tsc --version
npx tsc6 --version
npx tsc --version should print 7.0.2 and npx tsc6 --version 6.0.3. One write-up of this fix saw a stale tsc that printed 6.0.3 after converting in place, until node_modules was deleted. My npm 11.6.2 didn't do that, but a reinstall takes seconds, so I'd do it anyway. Leave package-lock.json alone in a real repo, because deleting it re-resolves every transitive dependency along with TypeScript. Commit the updated lockfile with the change.
Run lint and typecheck as separate CI steps. If you don't have a pipeline yet, my guide to setting up CI/CD with GitHub Actions covers the workflow file.
ESLint gets its type information from the 6.x API while tsc is 7.x. The aliases don't bring back tsconfig options TypeScript 7 removed, so a config that passes in one compiler can still fail in the other. Run both commands after any tsconfig change.
Why does typescript-eslint fail on TypeScript 7?
Because TypeScript 7.0 ships no compiler API, and typescript-eslint is built on that API. Microsoft says so plainly in the July 8, 2026 release post: "While TypeScript 7.0 is here, it does not ship with an API. We expect TypeScript 7.1 to ship with a new (and different) API".
So the peer range is honest. The dependency versions page documents support for >=4.8.4 <6.1.0, and npm refuses to build a tree that breaks it. On issue #12518, maintainer kirkwaiblinger put it in one line: "typescript-eslint isn't compatible with TS 7 at this time, because there is no TS 7 API at this time." The reporter on that issue found that require("typescript") on TS 7 exposes only version and versionMajorMinor, which is why forcing the install can't work.
That issue is now closed and locked as a duplicate, so follow #10940 instead. Bumping ESLint won't help. ESLint's own packages don't declare a typescript peer at all, and that issue says the ESLint repos are waiting on typescript-eslint too.
Which typescript-eslint error you get depends on the version
Everyone hits the same ERESOLVE at install. Force past it and the crash depends on your typescript-eslint version, because PR #12529 added an explicit guard at the package entry points. It first shipped in v8.65.0 on July 20, 2026.
| typescript-eslint | Plain npm install | After forcing the install, npx eslint src says |
|---|---|---|
| 8.63.0, 8.64.0 | ERESOLVE | TypeError: Cannot read properties of undefined (reading 'Cjs') from typescript-estree |
| 8.65.0 and newer (I tested 8.65.0 and 8.72.1) | ERESOLVE | typescript-eslint does not support TS 7.0. from typescript-eslint/dist/index.js |
Both errors come from the missing API. Upgrading typescript-eslint to get rid of the Cjs crash just buys you a clearer message.
I reproduced both crashes on Node 25 and npm 11.6.2
My environment was a Linux server with Node v25.2.1, npm 11.6.2 and a single CPU core, using eslint 10.14.0 and typescript-eslint 8.72.1. Each scenario got its own folder and the same small fixture, with a floating promise and an any so that typed rules have something to report. No real application was involved. The [exit code: N] lines below come from the wrapper I used to record output.
async function save(): Promise<void> {}
export function run(value: any) {
save();
return value;
}
import tseslint from "typescript-eslint";
export default [
...tseslint.configs.recommendedTypeChecked,
{ languageOptions: { parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname } } },
];
The install failure
With plain "typescript": "7.0.2" in devDependencies, the first npm install failed straight away:
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: a-eresolve@undefined
npm error Found: typescript@7.0.2
npm error node_modules/typescript
npm error dev typescript@"7.0.2" from the root project
npm error
npm error Could not resolve dependency:
npm error peer typescript@">=4.8.4 <6.1.0" from typescript-eslint@8.72.1
npm error node_modules/typescript-eslint
npm error dev typescript-eslint@"8.72.1" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
...
[exit code: 1]
Forcing it only delays the crash
npm's error practically invites you to retry with a flag. So I did. The npm docs describe legacy-peer-deps as ignoring peerDependencies completely and call it "not recommended".
$ npm install --legacy-peer-deps
added 96 packages in 13s
[exit code: 0]
$ npx eslint src
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.
See also https://github.com/typescript-eslint/typescript-eslint/issues/10940 for tracking typescript-eslint's support for TS >=7.1
Oops! Something went wrong! :(
ESLint: 10.14.0
Error: typescript-eslint does not support TS 7.0.
at Object.<anonymous> (/opt/blog-pipeline/runs/2026-11-10/lab/a-eresolve/node_modules/typescript-eslint/dist/index.js:52:11)
...
[exit code: 2]
npm install --force printed a stack of ERESOLVE overriding peer dependency warnings, finished, and hit that same guard. Rolling back to 8.63.0 and 8.64.0 gave me the older crash instead, at the same line in both:
Oops! Something went wrong! :(
ESLint: 10.14.0
TypeError: Cannot read properties of undefined (reading 'Cjs')
at Object.<anonymous> (/opt/blog-pipeline/runs/2026-11-10/lab/b-old-crash-8.63.0/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js:59:18)
...
[exit code: 2]
I made one mistake here. I first wrote eslint 9.39.0 into those older-version folders, then corrected it to 10.14.0 before installing, so everything recorded uses 10.14.0.
Overrides and a differently named alias
An overrides entry mapping typescript to the TS 6 package, with TS 7 still a direct dependency, failed for the reason npm's overrides docs give: you can't override a direct dependency unless both share the exact same spec.
npm error code EOVERRIDE
npm error Override for typescript@7.0.2 conflicts with direct dependency
...
[exit code: 1]
Next I added the TS 6 package under the name typescript-6 and left TS 7 as typescript. That still gave ERESOLVE, and forcing it ended at the guard again. The name must be typescript.
The alias layout, from a clean install
The package.json at the top of this post passed with no flags, and so did npm ci after I deleted node_modules:
$ npm install
added 98 packages in 8s
[exit code: 0]
$ rm -rf node_modules
$ npm ci
added 98 packages in 2s
[exit code: 0]
$ npx tsc --version
Version 7.0.2
[exit code: 0]
$ npx tsc6 --version
Version 6.0.3
[exit code: 0]
/opt/blog-pipeline/runs/2026-11-10/lab/c-alias/src/index.ts
2:28 error Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
3:3 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
4:3 error Unsafe return of a value of type `any` @typescript-eslint/no-unsafe-return
✖ 3 problems (3 errors, 0 warnings)
[exit code: 1]
Exit code 1 is good news. Those are typed rules firing on the fixture, so typed linting really ran. I'd planned for two errors and got three, because no-unsafe-return also caught line 4.
Converting the forced install in place, without deleting node_modules, also worked. npm install reported added 2 packages, and changed 1 package in 2s, tsc stayed at 7.0.2 and ESLint ran. That was one path on one npm version, so treat it as a data point.
Why tutorials disagree on 6.0.2 versus 6.0.3
The wrapper and the compiler have different versions. You'll see both numbers depending on what you ask:
$ node -p "require('typescript').version"
6.0.3
[exit code: 0]
$ node -p "require('typescript/package.json').version"
6.0.2
[exit code: 0]
$ ls -la node_modules/.bin/tsc node_modules/.bin/tsc6 node_modules/.bin/tsserver
lrwxrwxrwx 1 root root 29 Nov 8 22:43 node_modules/.bin/tsc -> ../@typescript/native/bin/tsc
lrwxrwxrwx 1 root root 22 Nov 8 22:43 node_modules/.bin/tsc6 -> ../typescript/bin/tsc6
lrwxrwxrwx 1 root root 31 Nov 8 22:43 node_modules/.bin/tsserver -> ../@typescript/old/bin/tsserver
[exit code: 0]
@typescript/typescript6 6.0.2 depends on @typescript/old, an alias for typescript@^6, and that resolved to 6.0.3. npm ls typescript --all only ever shows 6.0.2, so don't use it to work out which compiler ESLint gets.
A real type error, and what each tool does with it
A clean project prints nothing from either tsc, so I added a file with a deliberate error to prove both were checking, and deleted it afterwards.
$ printf 'export const broken: number = "not a number";\n' > src/broken.ts
$ npx tsc --noEmit
src/broken.ts(1,14): error TS2322: Type 'string' is not assignable to type 'number'.
[exit code: 1]
$ npx tsc6 --noEmit
src/broken.ts(1,14): error TS2322: Type 'string' is not assignable to type 'number'.
[exit code: 2]
$ npx eslint src/broken.ts
[exit code: 0]
tsc 7.0.2 exited 1 and tsc6 exited 2, so a CI script that compares against one specific non-zero code would break when you switch compilers. ESLint passed a file that doesn't type-check, which is why lint can't stand in for typecheck.
How much faster TS 7 was on one core
I generated 500 interlinked modules full of generics and mapped types and ran each compiler three times, alternating between them.
--- run 1: npx tsc --noEmit -p tsconfig.timing.json
real 0m1.582s
user 0m1.242s
sys 0m0.248s
exit code: 0
--- run 1: npx tsc6 --noEmit -p tsconfig.timing.json
real 0m5.313s
user 0m4.756s
sys 0m0.427s
exit code: 0
...
Averaged over the three runs, tsc 7.0.2 took 1.512s of wall-clock time and tsc6 took 5.300s, so TS 6 needed about 3.5 times as long. That's one machine, one fixture. The times include npx startup, and with a single core any gain from parallel work can't show up.
Stop Renovate and Dependabot from reopening the TypeScript 7 bump
If you're staying on plain TypeScript 6, cap the update. If you move to the aliases, remove that cap, because the alias changes what Renovate thinks typescript is. I ran Renovate 44.222.5 in extract mode on the alias layout, and this is what it recorded (Node 25 is outside its supported engines, so it logged an error and exited 1, but extraction finished):
{
"depType": "devDependencies",
"depName": "@typescript/native",
"currentValue": "^7.0.2",
"npmPackageAlias": true,
"packageName": "typescript",
...
},
{
"depType": "devDependencies",
"depName": "typescript",
"currentValue": "^6.0.2",
"npmPackageAlias": true,
"packageName": "@typescript/typescript6",
...
}
Those two entries are the reverse of what I expected. matchPackageNames reads packageName, so a rule on typescript now targets @typescript/native, the entry you want to keep updating. The common cap looks like this, and it only makes sense in a repo with no aliases:
{
"packageRules": [
{
"matchPackageNames": ["typescript"],
"allowedVersions": "<7.0.0"
}
]
}
With aliases you may not need a rule at all, since the typescript key now looks up @typescript/typescript6. If you want a guard anyway, match the key with matchDepNames, which checks depName rather than packageName. Don't add matchUpdateTypes to the same rule, because Renovate doesn't allow it alongside allowedVersions.
{
"packageRules": [
{
"matchDepNames": ["typescript"],
"allowedVersions": "<7.0.0"
}
]
}
Dependabot has a documented ignore option for the plain-TS 6 case:
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
ignore:
- dependency-name: "typescript"
update-types: ["version-update:semver-major"]
I only ran Renovate's extraction, so no update lookup or packageRules matching happened, and I had no hosted repo for real PRs. I couldn't confirm how Dependabot treats npm: aliases at all. Check the first bot PR after adding a rule.
What TypeScript 7.1 does and doesn't change
Installing 7.1 by itself doesn't lift the block. TypeScript 7.1 Beta came out on October 20, 2026. I tried it both ways. With "@typescript/native": "npm:typescript@7.1.0-beta" the alias layout worked unchanged, with tsc reporting 7.1.0-beta and ESLint finding the same three problems. As plain typescript, it hit ERESOLVE, and forcing it ended at the same guard, still reading typescript-eslint does not support TS 7.0.
The canary doesn't help either. When I checked on November 8, 2026:
$ npm view typescript-eslint@canary version peerDependencies --json
{
"version": "8.72.2-alpha.11",
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
"typescript": ">=4.8.4 <6.1.0"
}
}
[exit code: 0]
7.1's new API lives in new entry points. The beta's exports list ./sync, ./async, ./fs, ./ast and several more, so typescript-eslint needs real work to move over. That work is PR #12803, still open, which describes an opt-in projectService: { EXPERIMENTAL_backend: 'tsgo' }. A September 29 update on the tracking issue says the work "is looking more and more stable", and also tempers one hope: "we're not expecting performance to be significantly better with TS7 than TS6 at least for this initial IPC-based version."
I wouldn't plan around a date. The 7.1 iteration plan slipped by about two weeks at the beta, and I couldn't find revised RC or stable dates. I'll drop the aliases when npm view typescript-eslint@latest version peerDependencies --json shows a range that allows 7.x, swap them for one plain typescript dependency, and check that typed lint still passes.
When I'd skip the aliases and stay on TypeScript 6
Vue, MDX, Astro, Svelte and similar workflows are the clearest case. The 7.0 post says they "will need to continue using TypeScript 6.0 for now". Angular sits in between, with 7.0 for CLI tsc and 6.0 for editor support. I didn't test any framework checker or editor integration. A July report also had Next.js complaining that the required TypeScript packages weren't installed once TS 7 was in place, so run a build on a branch before you merge the bump.
Small projects don't need this. If tsc finishes in a few seconds, the extra lines in package.json buy you very little. Pin TS 6 and move on. The undici mismatch behind Node 26's fetch failures is the same kind of problem: it comes down to which version sits where, and a boring pin often holds until upstream catches up.
If you want off the TS 6 API entirely, look at oxlint. Its type-aware mode needs TypeScript 7.0+, installs with npm add -D oxlint-tsgolint@latest and runs with oxlint --type-aware. Its docs claim 59 of 61 type-aware rules from typescript-eslint. I haven't run it. Swapping linters is a bigger change than two alias lines, so I'd only look at it if lint time is already hurting.
FAQ
When will typescript-eslint support TypeScript 7?
There's no release date yet. The tracking issue is #10940, where a September 29, 2026 update called the work-in-progress TypeScript 7.1 support more and more stable, and PR #12803 adds an opt-in tsgo backend. Neither 8.72.1 nor canary 8.72.2-alpha.11 allows 7.x in its peer range, so watch that range rather than the TypeScript release notes.
What if you'd rather not run two compilers?
Pin typescript to ~6.0.3 and wait. typescript-eslint 8.72.1 accepts 6.0.x, so you need no aliases and only one compiler reads your tsconfig. You give up the TypeScript 7 type-check speed. For a small repo I'd take that trade. Where tsc is the slow step in CI, I'd use the aliases.
Is there really a TypeScript 6.0.3, or is 5.x still current?
Yes, 6.0.3 exists on npm, and it's what the alias ends up running. @typescript/typescript6 is a 6.0.2 wrapper that depends on @typescript/old, an alias for typescript@^6, which resolved to 6.0.3 in my test. Be careful with advice to pin typescript@^6.9, because nothing in the registry data I checked shows a 6.9 release.
What is @typescript/native in package.json?
It's a local alias name, not a separate compiler. The npm: prefix installs the ordinary typescript package at 7.x into node_modules/@typescript/native, and its tsc binary is what node_modules/.bin/tsc points to. Microsoft's TypeScript 7.0 announcement uses that name, so I'd keep it. The next person reading package.json can search for it.
How do you keep the setup honest in CI?
Run npm ci, then lint and typecheck as two separate steps, because neither one replaces the other. Print npx tsc --version in the job too, so the log shows which compiler ran. Test for any non-zero exit rather than one specific code, since tsc and tsc6 used different codes in my test.
When is a full TypeScript 7 migration safe?
Once nothing in your tree still needs the old compiler API. Run npm ls typescript --all to see every package that depends on typescript, then check each one's supported range. typescript-eslint is only the loudest. Framework template checkers count too, and a tsconfig option TypeScript 7 removed can fail the build after the switch, so try it on a branch first.