Maintain different versions of Angular CLI on the Same Machine

Indepthcoder
3 min readApr 10, 2020

--

In this article, we will be discussing to create projects with different Angular Versions.

Angular 1–9

Angular is developed by Google and is an open-source and one of the most used javascript structures at present. Google is taking special care to continuously update the angular version. Creating a situation for the developer to work with different versions. Thanks to (NVM)” that can permit you to switch between adaptations. However, there is a workaround that I am utilizing at. Here introduce Angular-CLI,

The Angular CLI [Global]

When we all got started using Angular CLI, the first thing they had us do was to install Angular CLI globally using npm install -g.

Why we need Angular Cli Globally?

If you don’t, you will get an error that looks something like this:

Follow Steps To Install Angular CLI locally

Dis: I have Angular 8 Installed Globally. and will be installing 9 Locally

angular — 8

Step 1: Create a folder in one of your local computer drives. I would like to create an Angular 9 project. in this tutorial, I have created the ‘ng-4’ folder on my Desktop

Step 2: Open your terminal and set working dir to “ng-9” that you just created on the Desktop of your machine.

Step 3: Now install Angular-CLI the version you required in my case its. 9 since that is the version that will install Angular into your project folder(ng-9). Make sure while installation you are not using -g at the end of the installation command.

.Here is the installing command

npm install @angular/cli@ for any other version

npm install @angular/cli for latest version

installation successful
Angular 9 CLI

Step 4: Now to create your angular project inside that folder using Terminal.

ng new <project-name>

My case : ng new angular-9-demo`

Step 5: select current directory to

cd angular-9-demo`

npm install`

Step 6: Delete The files package.json`, node_modules` in the previous dir.

in my case ng-9`

Step 7: All Set Angular 9 ` installed Successfully

!! Cheers if you like, the clap below.

--

--

Indepthcoder
Indepthcoder

Written by Indepthcoder

Programming enthusiast and JavaScript lover😍 years of happiness😊 Occasionally, I like to express my thoughts into articles🧠

No responses yet