Upgrade from Angular 11 to 12 causes peer dependency conflict

I had to use npm v6 to make a successful update:

npm -g i npm@^6
npm i
ng update @angular/cli@^12 @angular/core@^12

I had got same error on every version angular update when i used official update guide https://update.angular.io/ and command npx @angular/cli@12 update @angular/core@12 @angular/cli@12. After long googling and trying i found next way for angular and angular material update (example for 10 to 11 update):

npx @angular/cli@11 update @angular/core@11 @angular/cli@11

getting subj error

remove node_modules and package-lock.json

npm install

Git commit

ng update @angular/core@11 --migrate-only --from 10 --to 11

Git commit

ng update @angular/cli@11 --migrate-only --from 10 --to 11

Git commit

npx @angular/cli@11 update @angular/material@11 @angular/[email protected]

I had this same issue which was confusing as a beginner

I initially tried this command, but I just got another error

ng update @angular/cli @angular/core

I then found this link https://github.com/angular/angular-cli/issues/20843 and one person said to do this global cli command, this seemed to have fixed the issue when creating a new project

npm i @angular/cli -g

I can now create my new project command e.g.:

ng new example --routing false --style css --skip-git --skip-tests

enter image description here