manfredsteyer / ngx-build-plus

Extend the Angular CLI's default build behavior without ejecting, e. g. for Angular Elements
1.19k stars 136 forks source link

Ngx-build-plus can't run on Angular 14 #358

Open martynas04 opened 1 year ago

martynas04 commented 1 year ago

Hello. Yesterday I've tried to install ngx-build-plus version 14 , but encountered with interesting issue. As I can see in dependancies list we have @schematics/angular and @angular-devkit/build-angular dependancies. Those are not fixed version dependancies but >=14.0.0 . Around 4 days ago Angular released version 15.0.0 of those libraries. So now when You trying to install ngx-build-plus version 14 , it will depend on Anglular 15 because of those dependancies. Can You fix those dependancies and make them fixed version for Angular 14 ? Thanks!

image
mirzinho commented 1 year ago

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...

tankje commented 1 year ago

I'm facing the same issue but with Angular 15. I don't want to upgrade to 16 just yet and I'm in a critical situation.

warning "ngx-build-plus > @angular-devkit/build-angular@16.0.1" has incorrect peer dependency "@angular/compiler-cli@^16.0.0".
warning "ngx-build-plus > @angular-devkit/build-angular > @ngtools/webpack@16.0.1" has incorrect peer dependency "@angular/compiler-cli@^16.0.0".

I tried moving "ngx-build-plus": "15.0.0" at the bottom of devDependencies but didn't solve.

mirzinho commented 1 year ago

I'm facing the same issue but with Angular 15. I don't want to upgrade to 16 just yet and I'm in a critical situation.

warning "ngx-build-plus > @angular-devkit/build-angular@16.0.1" has incorrect peer dependency "@angular/compiler-cli@^16.0.0".
warning "ngx-build-plus > @angular-devkit/build-angular > @ngtools/webpack@16.0.1" has incorrect peer dependency "@angular/compiler-cli@^16.0.0".

I tried moving "ngx-build-plus": "15.0.0" at the bottom of devDependencies but didn't solve.

try using overrides


"overrides": {
    "@angular-devkit/build-angular": "^15.2.0",
    "@angular-devkit/core": "^15.2.0"
  }
tankje commented 1 year ago

that's exactly how I ended up making it work. thanks for following up :]

tsmgodoi commented 1 year ago

If you're using yarn, you should use the following:

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

It would be nice for the next versions of this package if the devs could change the dependencies to be more restrictive on the major version of Angular.