How to switch Angular CLI to older version
If you are working on an Angular project and need to switch to an older version of Angular CLI, follow these steps to safely and efficiently make the switch.
Step 1: Uninstall current version
Before switching to an older version, it’s important to first uninstall the current version of Angular CLI. Open your terminal or command prompt and run the following command:
npm uninstall -g @angular/cli
Step 2: Install the older version
After uninstalling the current version, you can now install the older version of Angular CLI. In your terminal or command prompt, run the following command:
npm install -g @angular/cli@
Replace “
Step 3: Verify installation
Once the installation is complete, you can verify that the older version has been successfully installed. Run the following command in your terminal or command prompt:
ng --version
This will display the version of Angular CLI that is currently installed. If the older version is displayed, then the installation was successful.
Step 4: Update project dependencies
After switching to the older version of Angular CLI, it’s a good idea to update your project’s dependencies to match the version you are now using. This will ensure that your project runs smoothly with the older version. Run the following command in your terminal or command prompt:
npm install
This will update your project’s dependencies to match the version of Angular CLI you have just installed.
Following these steps will allow you to safely switch to an older version of Angular CLI for your project. Make sure to check the compatibility of the older version with your project before making the switch. Happy coding!
Thank you <3