Home > Software engineering >  Error when creating a new project using Angular CLI 13.1.0
Error when creating a new project using Angular CLI 13.1.0

Time:12-10

I'm getting the following error when creating a new project using Angular CLI v13.1.0

\ Installing packages (npm)...npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/typescript
npm ERR!   dev typescript@"~4.5.2" from the root project
npm ERR!   peer typescript@">=4.4.3 <4.6" from @angular-devkit/[email protected]
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"~13.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer typescript@">=4.4.2 <4.5" from @angular/[email protected]
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   dev @angular/compiler-cli@"~13.0.0" from the root project
npm ERR!   peer @angular/compiler-cli@"^13.0.0 || ^13.1.0-next" from @angular-devkit/[email protected]
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"~13.1.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\user\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Local\npm-cache\_logs\2021-12-10T12_46_21_814Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.

I'm using Node JS version 16.13.1 and npm version 8.1.2

I tried clearing npm cache with --force, also reinstalled Node JS. Still no luck.

CodePudding user response:

This is just a TypeScript patch version issue which is being tracked here: https://github.com/angular/angular-cli/issues/22333, so just downgrade or npm i --force until they fix it.

CodePudding user response:

go to this path

C:\Users\user\AppData\Local

and delete this folder.

npm-cache

then test it.

  • Related