This article is a mirror article of machine translation, please click here to jump to the original article.

View: 4435|Reply: 3

[Angular] Angular-cli creates a specified version of the Angular project

[Copy link]
Posted on 2/16/2023 8:28:20 PM | | | |
Requirements: When the Angular CLI is installed globally, you can directly create an Angular project through the ng new command, and the main version of the created project is the same as the CLI version. How to do it without uninstalling the Angular CLI and then reinstalling it,Create a project with a specified version of Angular

Due to compatibility issues with third-party packages that need to be referenced in lower versions of Angular projects.

First, let's take a look at the globally installed angular-cli version, as shown below:



Angular CLI: 8.3.29
Node: 16.15.0
OS: win32 x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.803.29
@angular-devkit/core         8.3.29
@angular-devkit/schematics   8.3.29
@schematics/angular          8.3.29
@schematics/update           0.803.29
rxjs                         6.4.0
solution

Let's say we need to create an Angular 6 application with the following command:



Then, create a project with the following command:

As shown below:



(End)





Previous:ESXI system downgrade and rollback
Next:Post-robot example of browser window communication
 Landlord| Posted on 2/16/2023 8:29:14 PM |
Easy way: example: npm install @angular/cli@6 The -g flag here tells npm to perform this install globally. The last 6 tells npm that I want the latest available version 6.

If I want to create a new app for Angular 5, I'll do this:



Keep in mind that the Angular CLI is version 1.7 of Angular 5.

If I want to create a new app for Angular 6, I'll do this:



If I want to create a new application for Angular 7, I would do this:



If I want to create a new app for Angular 12, I would do this:



I hope this helps, thank you ......!
Posted on 2/16/2023 9:32:30 PM |
Learn to learn
 Landlord| Posted on 2/27/2025 8:27:11 AM |
The best options are as follows:

angular/cli is temporarily downloaded to:%LOCALAPPDATA%\npm-cache\_npx\
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com