Solutions:


When I was getting version error issues, the Following command worked for me:

First, run:

    npm update

Second run:

    ng update

Third run: (It will update all the mismatching packages)

    ng update --all --force


OR
Run this command which will  Perform a basic update to the current stable release of the core framework
 and CLI by running the following command.

ng update @angular/cli@^<major_version> @angular/core@^<major_version>