Assuming you are upgrading from Angular 8.0 to Angular 9.0 follow the following steps:
1. rm -rf node_modules package-lock.json 2. npm install @angular-devkit/schematics@8 3. ng update @angular/core@8 @angular/cli@8 4. ng update @angular/core@9 @angular/cli@9
In case you face any Peer dependency warnings when running the commands above run npm uninstall affected_package_name and then run the steps below:
1. npm i 2. ng update @angular/core@8 @angular/cli@8 3. ng update @angular/core@9 @angular/cli@9 4. npm i compatible_affected_package_name
You can run npm uninstall @angular-devkit/schematics after successful update.
Note: Always follow the Angular update Guide. You can swap the current and target angular versions depending on your situation. Before moving to higher versions ensure that all of your dependencies can work on your target version.