Thursday, April 21, 2022

Error: The Angular Compiler requires TypeScript 4.2.3 and 4.4.0 but 4.6.3 was found instead.

After resolve this error, ng serve brings up new error.


Error: The Angular Compiler requires TypeScript >=4.2.3 and <4.4.0 but 4.6.3 was found instead.


So again version mismatch, but this time error it self it clear so I easily fixed this error like pro.

Again I changed typescript version  from "typescript""^4.3.5" to "typescript""4.3.5".

changed What happen when we have while doing npm install angular finds most recent version of typescript, in package-lock.json "typescript""4.6.3" is got update. so I have change "typescript""4.3.5" in package.json.

This solved my issue. 


Conclusion: If you face any weird error from core/webpack or any check your typescript and angular version between package.json and package-lock.json so that we can find between what you expected to load to build and what angular try to find.

No comments:

Post a Comment