Error: The Angular Compiler requires TypeScript >=4.0.0 and <4.1.0 but 4.1.2 was found instead [closed]
Asked Answered
Q

0

14

While migrating and existing app to Angular 11, I'm facing the following error:

Error: The Angular Compiler requires TypeScript >=4.0.0 and <4.1.0 but 4.1.2 was found instead.

I'm not sure from where the 4.1.2 dependency is coming. Running the tsc from the global installation returns 4.0.5:

tsc --version
Version 4.0.5

Running the local version returns the same value:

npx tsc --version Version 4.0.5

I know that I can disable the TS version checking, but I'd really love to know from where that 4.1.2 version is coming from.

Ideas?

Quesnay answered 23/11, 2020 at 14:58 Comment(4)
What does ./node_modules/.bin/tsc --version say? Which version is specified in your package file, and is it pinned to what Angular needs (e.g. ~4.0.5)?Benfield
It's referencing 4.1.2, but from where it's comong frpm? devDependencies references version 4.0.5...Quesnay
Does it have "4.0.5" exactly, or "^4.0.5"? Do you have package-lock.json or yarn.lock, and what does that say got resolved?Benfield
duh...it had ^...stupid mistake. thanks.Quesnay

© 2022 - 2024 — McMap. All rights reserved.