"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > Changing the Angular CLI version

Changing the Angular CLI version

Published on 2024-11-01
Browse:693

Changing the Angular CLI version

Angular is constantly updating its versions, every 6 months. There are two ways to make the change: using the Node.js version manager or via command line.

a) Via Command Line:
First, check the Angular version you are using with: ng serve. Then, open the terminal in administrator mode and uninstall the current version: npm uninstall -g @angular/cli.

Now, verify that the cache is correct: npm cache verify. If there’s no error, proceed; otherwise, clear the cache with: npm cache clean --force.

Next, install the desired version (in this case, version 16 which installs the most stable version): npm install -g @angular/cli@16. Verify the installation with: ng version.

b) Via NVM:
Select the version of Node.js to use and install the compatible Angular version with: npm install @angular/[email protected].

Note: The LTS (Long Term Support) version of Node.js is the stable version and is recommended for most production projects as it receives support and security updates.

You can install a different Angular version for each Node.js version. To see the Angular version: ng v.

Check compatibilities at: https://angular.dev/reference/versions

Release Statement This article is reproduced at: https://dev.to/samirabawad/changing-the-angular-cli-version-1k34?1 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3