Please follow the steps to install the needed angular version
npm uninstall -g @angular/cli
ng --version
check if it is removed from global.
remove from global if not rm -rf /usr/local/bin/ng
or
where ng
rd /s /q C:\Users\YourUser\AppData\Roaming\npm\node_modules\@angular
npm cache clean --force
npm install --save-dev @angular/cli@latest