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?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Luis Abreu
  • 4,008
  • 9
  • 34
  • 63
  • 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`)? – jonrsharpe Nov 23 '20 at 14:59
  • It's referencing 4.1.2, but from where it's comong frpm? devDependencies references version 4.0.5... – Luis Abreu Nov 23 '20 at 15:21
  • 2
    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? – jonrsharpe Nov 23 '20 at 15:22
  • 4
    duh...it had ^...stupid mistake. thanks. – Luis Abreu Nov 23 '20 at 15:26

0 Answers0