3

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?

5
  • please share the error log what error you are getting Commented Mar 6, 2019 at 5:49
  • Not about error. I want to know whether it is possible? Commented Mar 6, 2019 at 5:52
  • Question heading updated please note Commented Mar 6, 2019 at 5:53
  • stackoverflow.com/questions/43344600/… Commented Mar 6, 2019 at 6:07
  • okay got your question added answer please check thanks Commented Mar 6, 2019 at 6:12

3 Answers 3

4

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
Sign up to request clarification or add additional context in comments.

3 Comments

Can I keep the cli version as 6. Without uninstall and install again? Why need to install again?
I saw one more like this ng new project_name --ng6
Yes you can keep the cli version at 6, I wasn’t sure if you wanted to stay at 7 or not.
2

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

1

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!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.