I've tried a lot to fix this problem, but I can't find any solution. This is the error:
npm ERR! While resolving: @angular-devkit/[email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/compiler-cli
npm ERR! dev @angular/compiler-cli@"^12.2.16" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler-cli@"^14.0.0" from @angular-devkit/[email protected]
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"^14.2.4" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/[email protected]
npm ERR! node_modules/@angular/compiler-cli
npm ERR! peer @angular/compiler-cli@"^14.0.0" from @angular-devkit/[email protected]
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"^14.2.4" from the root project
I've tried to downgrade angular/compiler-cli, but then I get the next error. Also used --force and --allow-dirty but the error still occurse. My goal was to upgrade angular from version 13 to 14. Hope someone can help..
You can check peer dependencies of a package using the command below.
From this you will notice that
@angular-devkit/[email protected]requires@angular/compiler-cliversion 14.n.n (see https://semver.org/).To remedy this problem, you can firstly try typing
ng update(https://angular.io/cli/update) and then updating each package as per results.Alternatively (probably not recommended), you can try manually installing a specific version of the peer dependencies
npm install [email protected].Another useful "trick" I have used to investigate NPM versions for new projects is to quickly create a new empty Angular project using the CLI.
I assume you have installed @angular\cli globally with correct version.
Something like the below will be quick as no installation of node_modules, etc.
Examine the
package.jsonand note the versions and compared and contrast to your projectpackage.json.