I keep encountering this recurring error message:
- 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.
Within package.json, my entry for TypeScript is:
"typescript": "^4.3.2"
To address the issue, I deleted all files in node_modules, initiated an npm install, yet the problem persisted. As a troubleshooting step, I uninstalled TypeScript followed by installing a specific version using the command:
npm install <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="dda9a4adb8aebeafb4ada99de9f3eef3ef">[email protected]</a>
This was then succeeded by running npm update. Despite these actions, the error persists when triggering ng build.