Run the following command to update the Angular version of your project
ng update @angular/cli && ng update @angular/core
If you are getting the peer conflict error then you can run this:
npm i --legacy-peer-deps
After that you can run ng update @angular/cli && ng update @angular/core command again to update the Angular version.