Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fixed this dependence problems

I update my angular and my angular project version to angular 7. But... When I try to run I have this problem:

Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=3.1.1 <3.2", would install "3.2.2").
Incompatible peer dependencies found. See above.

how I can fixed it? If is possible install a version of angular/compiler-cli supported typescript 3.2.2

like image 872
Lucas Alves Avatar asked Dec 15 '18 15:12

Lucas Alves


People also ask

What is peer dependency?

A peer dependency specifies that our package is compatible with a particular version of an npm package. If a package doesn't already exist in the node_modules directory, then it is automatically added. As you install a package, npm will automatically install the dev dependencies.

Are peer dependencies required?

Peer dependencies are almost like normal dependencies, but instead of defining a strong requirement between A and B (i.e the project you're developing and the project it depends on), they're meant to specify a package that your code requires, but doesn't directly require it.

How do I know what version of angular I have?

Checking the Angular VersionOpen the Terminal + view in your project and type ng version . For recent versions of Angular, this will list the versions of several Angular packages that you have installed in your project.


1 Answers

I've got the same issue and the next steps helped me to fix it:

  1. To the package.json file at the devDependencies add the next row "typescript": "^3.1.6"

  2. Run ng update @angular/cli or ng update --all

  3. Now when you'll run ng serve will get the next error ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.2.0 but 3.2.2 was found instead.

  4. To fix this install the same typescript version 3.1.6 with npm npm i [email protected] --save-dev --save-exact or yarn yarn add [email protected] --save-dev

Now when you run ng serve everything should work fine and angular cli will be updated

like image 177
Mavka Poltavka Avatar answered Sep 23 '22 04:09

Mavka Poltavka