angularangular-cliangular-cli-v8angular-cli-v9

How to create Angular 8 project using Angular CLI 9


I'm using Angular CLI 9.1.1 but need to create a project with Angular 8.
I also have other projects using Angular 9, so I don't want to install Angular 8 CLI globally.

Is there any option to create an Angular 8 project using Angular CLI 9?


Solution

  • You don't need a global install of Angular CLI. It's marginally more tiresome, but certainly less than juggling global installs. Here's the procedure:

    1. Create a new directory and enter it.
    2. There: npm init and npm i @angular/cli@8.
    3. Then, instead of ng new myapp, run npx ng new myapp.

    (Or at least it worked on my machine...)