Stabzs / Angular2-Toaster

Angular2-toaster is an asynchronous, non-blocking Angular Toaster Notification library
MIT License
334 stars 93 forks source link

Can't upgrade to Angular 10 #204

Closed linflux closed 4 years ago

linflux commented 4 years ago

I try to upgrade to Angular 10 but I get this error:

ng update @angular/core @angular/cli The installed local Angular CLI version is older than the latest stable version. Installing a temporary version to perform the update. Installing packages for tooling via npm. Installed packages for tooling via npm. Using package manager: 'npm' Collecting installed dependencies... Found 50 dependencies. Fetching dependency metadata from registry... Package "angular2-toaster" has an incompatible peer dependency to "@angular/core" (requires "^8.0.0" (extended), would install "10.0.0"). Package "angular2-toaster" has an incompatible peer dependency to "@angular/common" (requires "^8.0.0" (extended), would install "10.0.0"). Package "angular2-toaster" has an incompatible peer dependency to "@angular/compiler" (requires "^8.0.0" (extended), would install "10.0.0"). × Migration failed: Incompatible peer dependencies found. Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together. You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.

graphicsxp commented 4 years ago

any update on this ?

linflux commented 4 years ago

any update on this ?

I tried to force the update and apparently it worked. I was able to run the application.

graphicsxp commented 4 years ago

Hum. Forcing the update might hide other issues with packages that may not be ready yet for angular 10. But good for you if it works.

A fix or an answer from author would be appreciated

dphochman commented 4 years ago

Our library project and application projects are upgraded to Angular 10. We also used ng update's --force option because of the dependency issues in angular2-toaster. Now, every npm install displays these issues:

npm WARN angular2-toaster@8.0.0 requires a peer of @angular/common@^8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular2-toaster@8.0.0 requires a peer of @angular/compiler@^8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular2-toaster@8.0.0 requires a peer of @angular/core@^8.0.0 but none is installed. You must install peer dependencies yourself.

Perhaps this can be resolved by running ng update on angular2-toaster, by manually updating some devDependencies, and by adding the module as a type to ModuleWithProviders in the forRoot and forChild methods. Maybe more, but it's worth a try..

philjones88 commented 4 years ago

I started investigating this as it appeared to be quite simple, running ng update yields:

Using package manager: 'npm'
Collecting installed dependencies...
Found 44 dependencies.
    We analyzed your package.json, there are some packages to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       8.1.0 -> 10.1.0          ng update @angular/cli
      @angular/core                      8.1.0 -> 10.1.0          ng update @angular/core
      rxjs                               6.5.2 -> 6.6.2           ng update rxjs

But when you then try to update using ng update @angular/cli @angular/core rxjs you are greated by:

Using package manager: 'npm'
Collecting installed dependencies...
Found 44 dependencies.
Fetching dependency metadata from registry...
                  Package "codelyzer" has an incompatible peer dependency to "@angular/core" (requires "^2.3.1 || >=4.0.0-beta <5.0.0" (extended), would install "10.1.0").
                  Package "@angular-devkit/build-angular" has a missing peer dependency of "@angular/localize" @ ">=10.1.0-next.0 < 11".
                  Package "codelyzer" has an incompatible peer dependency to "@angular/compiler" (requires "^2.3.1 || >=4.0.0-beta <5.0.0" (extended), would install "10.1.0").
                  Package "awesome-typescript-loader" has an incompatible peer dependency to "typescript" (requires "^2.7 || ^3", would install "4.0.2").
Incompatible peer dependencies found.
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.

It seems awesome-typescript-loader is deprecated as the repo is now archived? https://github.com/s-panferov/awesome-typescript-loader

Stabzs commented 4 years ago

This is now published as version 10.0.0. Thank you all for your patience and my apologies for the delay.