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
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.
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.
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.
I've got the same issue and the next steps helped me to fix it:
To the package.json
file at the devDependencies
add the next row "typescript": "^3.1.6"
Run ng update @angular/cli
or ng update --all
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With