"The Angular Compiler requires TypeScript" after fresh `npm i` and `ng serve`
See original GitHub issueIssue type
I’m submitting a … (check one with “x”)
- bug report
- feature request
- question about the decisions made in the repository
Issue description
Exception after ng serve
C:\Data\Projects\Personalprojekt\ngx-admin-fork\node_modules\@angular\compiler-cli\src\typescript_support.js:65
throw new Error("The Angular Compiler requires TypeScript >=" + minVersion + " and <" + maxVersion + " but " + version + " was found instead.");
^
Error: The Angular Compiler requires TypeScript >=4.2.3 and <4.4.0 but 4.4.4 was found instead.
at checkVersion (C:\Data\Projects\Personalprojekt\ngx-admin-fork\node_modules\@angular\compiler-cli\src\typescript_support.js:65:19)
at Object.verifySupportedTypeScriptVersion (C:\Data\Projects\Personalprojekt\ngx-admin-fork\node_modules\@angular\compiler-cli\src\typescript_support.js:70:9)
at new NgtscProgram (C:\Data\Projects\Personalprojekt\ngx-admin-fork\node_modules\@angular\compiler-cli\src\ngtsc\program.js:47:38)
at AngularWebpackPlugin.updateAotProgram (C:\Data\Projects\Personalprojekt\ngx-admin-fork\node_modules\@ngtools\webpack\src\ivy\plugin.js:311:32)
at C:\Data\Projects\Personalprojekt\ngx-admin-fork\node_modules\@ngtools\webpack\src\ivy\plugin.js:188:24
at Hook.eval [as call] (eval at create (C:\Data\Projects\Personalprojekt\ngx-admin-fork\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:24:1)
at Hook.CALL_DELEGATE [as _call] (C:\Data\Projects\Personalprojekt\ngx-admin-fork\node_modules\tapable\lib\Hook.js:14:14)
at Compiler.newCompilation (C:\Data\Projects\Personalprojekt\ngx-admin-fork\node_modules\webpack\lib\Compiler.js:1043:30)
at C:\Data\Projects\Personalprojekt\ngx-admin-fork\node_modules\webpack\lib\Compiler.js:1088:29
at Hook.eval [as callAsync] (eval at create (C:\Data\Projects\Personalprojekt\ngx-admin-fork\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:22:1)
Current behavior: Exception appears.
Expected behavior: No exception should appear
Steps to reproduce:
rm -r node_modules
rm package-lock.json
npm i --legacy-peer-deps
ng serve
Other information:
The error appears because angular cli currently only supports 4.2. or 4.3. but not 4.4.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:12 (5 by maintainers)
Top Results From Across the Web
The Angular Compiler requires TypeScript >=3.4.0 and <3.5.0 ...
The Angular Compiler requires TypeScript >=3.4.0 and <3.5.0 but 3.5.3 was found instead. I've tried following things separately: npm install ...
Read more >Fix The Angular Compiler requires TypeScript versions
The next step is to install the mandatory typescript version, which is 4.0. 7. Next, run the ng --version command to list out...
Read more >TypeScript configuration - Angular
Typescript must be "transpiled" into JavaScript using the tsc compiler, which requires some configuration. This page covers some aspects of TypeScript ...
Read more >Ahead-of-time (AOT) compilation - Angular
The Angular ahead-of-time (AOT) compiler converts your Angular HTML and TypeScript code into efficient JavaScript code during the build phase before the ...
Read more >Angular compiler options
Like the TypeScript compiler, the Angular AOT compiler also supports extends in the ... Default is false , but when you use the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@elupanov Thanks for your reply and merging PRs, & it is the best open-source theme available right now in Angular, so, it is widely used, & Nebular components are also Awesome, so it’s fine not to add new features actively here, but issues like these were blocking users in installing this, so these must be checked atleast weekly 😃 Also, add in the readme that “It will NOT work in Node-16” . It is working fine in NODE-14.18.2 , because node-sass version used in package.json is 4.14, which WILL NOT SUPPORT Node 15 & 16 (screenshot attached)
@vaibhavkumar-sf thanks for the hint I’ve added installation notes with required NodeJS version