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 gettingTheParam– TheParam2019-03-06 05:49:28 +00:00Commented Mar 6, 2019 at 5:49
-
Not about error. I want to know whether it is possible?user1365067– user13650672019-03-06 05:52:29 +00:00Commented Mar 6, 2019 at 5:52
-
Question heading updated please noteuser1365067– user13650672019-03-06 05:53:41 +00:00Commented Mar 6, 2019 at 5:53
-
stackoverflow.com/questions/43344600/…Anand Murali– Anand Murali2019-03-06 06:07:34 +00:00Commented Mar 6, 2019 at 6:07
-
okay got your question added answer please check thanksTheParam– TheParam2019-03-06 06:12:29 +00:00Commented Mar 6, 2019 at 6: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/[email protected]`
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
3 Comments
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
Comments
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/[email protected]
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!