Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This version of CLI is only compatible with Angular versions ^15.0.0, but Angular version 14.2.12 was found instead. #361

Open
saket-r opened this issue Nov 30, 2022 · 4 comments

Comments

@saket-r
Copy link

saket-r commented Nov 30, 2022

Getting this error when using ngx-build-plus: 14.0.0 with Angular 14 project

I found that its because the version range is not fixed to the bound of 14.x series hence npm downloads @angular-devkit/build-angular, @angular-devkit/core etc . of15.x.x versions locally inside node_modules which in turns causes the issue

image

The correct fix would be to add a range in the package.json of ngx-build-plus something like >= 14.0.0 < 15.0.0

The workaround in the package.json of our project we can add resolutions object which makes sure npm downloads the required versions for our project

"resolutions": {
    "@angular-devkit/build-angular": "14.2.10",
    "@angular-devkit/core": "14.2.10"
  },
@frazzaglia
Copy link

Related to #358

@Lightllord
Copy link

guys, remove this exceeded dependencies for a good being

@mirzinho
Copy link

faced the same issue, move the "ngx-build-plus": "14.0.0" to the bottom of devDependancies in package.json.

worked like a charm for me...

@keeroll
Copy link

keeroll commented May 10, 2023

Faced the same issue here.

Error message:
This version of CLI is only compatible with Angular versions ^16.0.0,
but Angular version 15.2.9 was found instead.

Updated project to the Angular 15, but [email protected] installs dependencies for Angular 16.
image_2023-05-10_19-56-46

I tried to set required dependencies manually before ngx-build-plus, but it still gets the latest.

UPD:
Workaround with resolutions doesn't work for npm > 8.3.
Use overrides instead.

"overrides": {
    "@angular-devkit/build-angular": "^15.2.0",
    "@angular-devkit/core": "^15.2.0"
  }

keeroll added a commit to keeroll/ngx-build-plus that referenced this issue May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants