How to Update Angular CLI
We will introduce how to update Angular CLI from a smaller version to the latest.
Use the npm
Package to Update Angular CLI to the Latest Version
It is pretty easy to update the Angular CLI version, but many programmers have issues. If you have any project using an old version of Angular CLI, it is globally updated when we update the Angular CLI version, but the priority works differently. The local project version has higher priority over the global version.
We can update Angular CLI using the npm
package.
# CLI
npm uninstall -g @angular/cli
npm install -g @angular/cli@latest
These two commands will uninstall Angular CLI and install the updated version.
To update the local version of our project, we can use the following commands.
# CLI
rm -rf node_modules
npm uninstall --save-dev @angular/cli
npm install --save-dev @angular/cli
npm install
These commands will update the Angular CLI version of our local version.
Why Should We Update Angular CLI?
As the web ecosystem and Web is improving day by day, Angular is also improving continuously. Keeping the CLI and our projects to the latest date version of the Angular gives us the advantage of using new features, and many bugs from previous versions are optimized and fixed in new versions.
How To Check Angular CLI Version?
If you are looking to update the version of your Angular project, you can check its version first by using the following command by going into the project directory.
# angular
ng --version
Rana is a computer science graduate passionate about helping people to build and diagnose scalable web application problems and problems developers face across the full-stack.
LinkedIn