Can’t create new project in Angular: tsickle dependency problem

Published

I’ve installed:

  • node.js v15.6.0
  • npm 7.5.0
  • Angular CLI: 11.1.2

I’m running on Windows 10, 64bit.

I’m trying to create my first project by running:

ng new angular-demo

where "angular-demo" is project name. The command creates a project directory with some initial files, then it runs npm and fails with the following messages in the log file

67 verbose argv "W:nodejsnode.exe" "C:UsersTomaszAppDataRoamingnpmnode_modulesnpmbinnpm-cli.js" "install" "--quiet"
68 verbose node v15.6.0
69 verbose npm  v7.5.0
70 error code ERESOLVE
71 error ERESOLVE unable to resolve dependency tree
72 error
73 error While resolving: [email protected]
73 error Found: [email protected]
73 error node_modules/typescript
73 error   peer [email protected]"~4.0.0 || ~4.1.0" from @angular-devkit/[email protected]
73 error   node_modules/@angular-devkit/build-angular
73 error   peer [email protected]">=4.0 <4.2" from @angular/[email protected]
73 error   node_modules/@angular/compiler-cli
73 error     peer @angular/[email protected]"^11.0.0 || ^11.1.0-next" from @angular-devkit/[email protected]
73 error     node_modules/@angular-devkit/build-angular
73 error     peer @angular/[email protected]"11.1.1" from @angular/[email protected]
73 error     node_modules/@angular/localize
73 error       peerOptional @angular/[email protected]"^11.0.0 || ^11.1.0-next" from @angular-devkit/[email protected]
73 error       node_modules/@angular-devkit/build-angular
73 error     1 more (ng-packagr)
73 error   1 more (ng-packagr)
73 error
73 error Could not resolve dependency:
73 error peer [email protected]"~3.9.5" from [email protected]
73 error node_modules/tsickle
73 error   peerOptional [email protected]"~0.39.0" from [email protected]
73 error   node_modules/ng-packagr
73 error     peerOptional [email protected]"^11.0.0 || ^11.1.0-next" from @angular-devkit/[email protected]
73 error     node_modules/@angular-devkit/build-angular

I googled a bit and found that tsickle is some typescript-related tool and it supports only typescript version up to 3, not 4. I don’t know why angular tries to install this combination of typescript version and tsickle.

Source: Angular Questions

Published
Categorized as angular, angular-cli, tsickle Tagged , ,

Answers

I’m having the same problem.


Baylor Maloney

OK so I figured it out. I saw in a stackoverflow post someone said to run npm update -g @angular/cli and that worked for them so you may be able to try that but it unfortunately did not work for me. What did work was running ‘npm config set legacy-peer-deps true’


Baylor Maloney

I am also having same issue. how could we resolve this error.


sri

This is dependency conflict as it says typescript version have issues.
But even this error came there is a project folder is created.
You can run

npm install –force

command from the project directory where the package.json file and initial file generated. For your case run the command under angular-demo directory


Dr. Everette Mante MD

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq