27-May-2024
.
Admin
Hi, Dev
In this post, I will guide you through the process of upgrading Angular from version 17 to version 18 on Ubuntu.
While working on my Angular project, I realized I needed to upgrade from Angular 17 to Angular 18. A simple update command didn't work due to some configuration issues, prompting me to explore other upgrade methods.
There are two main approaches to upgrade from Angular 17 to 18. First, we'll try directly updating the Angular CLI version. If this approach fails, the alternative involves uninstalling and then reinstalling the Angular CLI. Here are the steps for both methods.
Following Way to Upgrade Angular 17 to 18 Version
Way 1: Update Angular CLI
Way 2: Update Angular CLI using reinstall
Let's see both ways:
Way 1: Update Angular CLI
You can directly upgrade your angular CLI version globally by using the update command of ng. so you can do it by bellow command.
ng update @angular/cli @angular/core
Now you can see ng version by following command:
ng version
Way 2: Update Angular CLI using reinstall
I will show you list of commands for update version angular 17 to angular 18 by using uninstall and upgrade angular version.
Uninstall Angular CLI:
npm uninstall -g @angular/cli
Clear Cache:
npm cache clean --force
npm cache verify
Install Angular CLI:
npm install -g @angular/cli
Now you have a new version of angular CLI. so you can check it by following the command:
ng version
You will see a layout bellow:
I hope it can help you...
#Angular