Angular: Upgrading to version 5 error: Version of @angular/compiler-cli needs to be 2.3.1 or greater. Current version is "5.0.0"

In this situation, you need to update the local install of the @angular/cli from 1.0.0 to 1.5.0. That many minor versions with the CLI includes a lot of changes, along with the changes in dependencies that come along with those updates.

To update the local version of your CLI to the latest version, use the following command from a command prompt/terminal open to the root directory of the project.

npm install --save-dev @angular/cli@latest

Or, you can just update the version in the package.json, and run npm install.

You could hide the warning the CLI shows when the global and local CLI versions are out of sync, but that could hide a solution to any issues you are having. To hide the warning run this command:

ng set --global warnings.versionMismatch=false

Best to keep this local and global versions in sync to avoid issues.

Tags:

Npm

Angular