I have a Angular material project that is very outdated and I need to updated to 13
After running npm outdated I see these results

According to the Angular update guide I need to upgrade only one mayor version at a time and it recommends these commands:
cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@8 update @angular/cli@8 @angular/core@8"
But after running that command I get these errors:
I have tried to update each one of those packages by hand but it becomes a nightmare of dependencies, that currently I'm unable to solve.
I want to be able to upgrade to Angular 13 (doing the needed code changes) and I want to know what is correct way to address this problem.
UPDATE
When using --force also fails with a different error

When running this command:
ng update --all --force

It turns out that migration from such and old version of Angular 7 to 13 was not as simple as any of the above answers.
What I ended up doing was to create a new Angular project ,using version 13, and then started copy pasting the following elements from the older version to the new one
Of course the list above is just for reference and it will change depending on your folder structure and angular version
Then I just run ng -s or let the typescript language service to tell me what where the sintax errors or missing parts (adding components to the modules, missing imports, etc)
Using WinMerge you can compare folders and files of both angular versions and compare package.json to determine which packages you have not installed yet.

I made sure that tsconfig files, app.modules.ts files where merged, and kept using the errors to guide me.
It was a demo application where I had to use any type in many places as a quick fix, but try to use strong types as much as possible
That can be boring, but is my code and I know better than trying to fix a non-ending nightmare of dependencies between old npm packages (some of them have even changed their names)
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