I have latest angular cli with version 7.7.3. I need angular 6 project using it. But I can able to create only angular 7 project from it using cli command ng new project_name. Is there any way to force create angular 6 project? Node version : 10.2.1. From git we can get seed but is it possible from latest cli?
-
please share the error log what error you are getting – TheParam Mar 06 '19 at 05:49
-
Not about error. I want to know whether it is possible? – user1365067 Mar 06 '19 at 05:52
-
Question heading updated please note – user1365067 Mar 06 '19 at 05:53
-
https://stackoverflow.com/questions/43344600/installing-a-specific-version-of-angular-with-angular-cli – Anand Murali Mar 06 '19 at 06:07
-
okay got your question added answer please check thanks – TheParam Mar 06 '19 at 06:12
3 Answers
The easiest way to do it would be too uninstall angular/cli globally
npm uninstall -g @angular/cli
then reinstall it globally at the version you want so..
npm install -g @angular/cli@6.0.0`
then in your terminal create a new angular project like so
ng new <project-name>
at that point it will build you an angular 6 app, from there you can now safely uninstall the @angular/cli
globally and reinstall the latest version like so
npm install -g @angular/cli@latest

- 8,827
- 19
- 77
- 152
-
Can I keep the cli version as 6. Without uninstall and install again? Why need to install again? – user1365067 Mar 06 '19 at 06:04
-
-
Yes you can keep the cli version at 6, I wasn’t sure if you wanted to stay at 7 or not. – Smokey Dawson Mar 06 '19 at 08:55
The following steps helped me to create angular 6 project from angular cli 7.3.3
Step 1 Create a new folder => mkdir angular6-project
Step 2 Go to that folder => cd angular6-project
Step 3 Check version => ng version so version is > Angular cli: 7.3.3
Step 4 that folder open cmd > npm init -y
Step 5 install angular cli 6 locally using > npm install @angular/cli@6
Step 6 check ng version it's version is > Angular 6.1
Step 7 You delete local pakcage.json file. Angular cli will complain when you try use ng new
Step 8 You can create Angular 6 application > ng new ng6-app

- 31
- 2
There is no way to create the older version of the angular project using the newer version of angular-cli.
To solve your issue you need to downgrade the angular-cli version 7.7.3 to 6.0.0 using below commands
Step 1: Uninstall current angular-cli 7.7.3 using below command
npm uninstall -g @angular/cli
Step 2: Install angular-cli 6.0.0 using below command
npm install -g @angular/cli@6.0.0
Step 3: Create Angular 6 Project using below command
ng new PROJECT-NAME
cd PROJECT-NAME
ng serve
Step 4: Now your project has its own local angular-cli installed,so you can now update your angular-cli version to 7.7.3 using below command
npm install -g @angular/cli@latest
Hope this help!

- 10,113
- 4
- 40
- 51