I installed Angular 13 globally, but I want to start a project with version 11. Do I have to remove Angular from the system altogether and install Angular 11?
-
1The version 13 CLI can build and serve an Angular 11 project, you don't need to install a project-local version and you certainly don't need to remove the CLI altogether. Or did you mean you wanted to create a new Angular 11 project using the version 13 CLI? – D M Apr 19 '22 at 19:49
-
1If you want to use the version 13 CLI to create a new Angular 11 project see [How to Create a specific version of Angular Project using CLI?](https://stackoverflow.com/questions/52331625/how-to-create-a-specific-version-of-angular-project-using-cli). tl;dr - `npx @angular/cli@11 new MyNewAngular11Project`. – D M Apr 19 '22 at 19:51
-
Thank you very much for doing this But why npx shouldn't we use ng? – davood beheshti Apr 19 '22 at 20:03
-
1If you use `ng new`, the project will be created using the version 13 CLI meaning the project will be Angular version 13. If you use `npx @angular/cli@11...`, the project will be created using the version 11 CLI (without having to install the version 11 CLI) meaning the project will be Angular version 11. – D M Apr 19 '22 at 20:08
-
Thank you very much my friend – davood beheshti Apr 19 '22 at 20:13
2 Answers
Have you tried using this npx
trick?
In short you can try running the scripts directly from the desired version by using
npx @angular/cli@7 new Angular7Project
to create an Angular project of that version.
Another option would be to install another cli specific to that project directory, instead of globally, so creating a directory then running npm install angular/cli@XXXXX
. Running your ng commands (eg. ng new
) in that folder will use the local cli version.

- 48
- 3
dont have any problem if you have a angular 13 in your system globally, if you start a project whit angular 11, only you have a warning tell you, that your globally version is mayor than your local.
this happen to if you downloaded a repository whit a version minor that you have globally
and of course the most logical suggestion if you need working whit components or plugins that only work right now on 11. well is the best work local whit angular 11