I'm constantly getting this error:
- Generating browser application bundles (phase: setup)...
An error occurred during the build:
Error: The Angular Compiler requires TypeScript >=4.2.3 and <4.4.0 but 4.5.4 was found instead.
at checkVersion (C:\..path..\Client\node_modules\@angular\compiler-cli\src\typescript_support.js:65:19)
at Object.verifySupportedTypeScriptVersion (C:\..path..\Client\node_modules\@angular\compiler-cli\src\typescript_support.js:70:9)
at new NgtscProgram (C:\..path..\Client\node_modules\@angular\compiler-cli\src\ngtsc\program.js:47:38)
at AngularWebpackPlugin.updateAotProgram (C:\..path..\Client\node_modules\@ngtools\webpack\src\ivy\plugin.js:310:32)
at C:\..path..\Client\node_modules\@ngtools\webpack\src\ivy\plugin.js:187:24
at Hook.eval [as call] (eval at create (C:\..path..\Client\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:28:1)
at Hook.CALL_DELEGATE [as _call] (C:\..path..\Client\node_modules\tapable\lib\Hook.js:14:14)
at Compiler.newCompilation (C:\..path..\Client\node_modules\webpack\lib\Compiler.js:1043:30)
at C:\..path..\Client\node_modules\webpack\lib\Compiler.js:1088:29
at Hook.eval [as callAsync] (eval at create (C:\..path..\Client\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:22:1)
An unhandled exception occurred: The Angular Compiler requires TypeScript >=4.2.3 and <4.4.0 but 4.5.4 was found instead.
See "C:\Users\...\AppData\Local\Temp\ng-aVWIPB\angular-errors.log" for further details.
In package.json I have
"typescript": "^4.3.2"
I removed all files under node_modules, ran npm install. It did not resolve the issue. uninstalled typescript and then again installed typescript specific version by running command:
npm install typescript@4.3.2
Then ran npm update. Still getting same error on running ng build.