Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 6: How to install a previous version of Angular project

How I can install a previous version of Angular project with the current Angular-cli version (Angular 6).

I found a command but is deprecated:

ng new my_project --ng4

like image 434
Ricky Avatar asked May 10 '18 12:05

Ricky


2 Answers

Since you want to use angular-cli to create new project, you need to install the version of @angular/cli that scaffolds angular 4 project.

Version of @angular/cli which scaffolds the Angular 4 project is 1.4.9.

So, using npm, do npm install @angular/[email protected], then use angular-cli commands.

like image 155
Basavaraj Bhusani Avatar answered Nov 18 '22 10:11

Basavaraj Bhusani


You can just have package.json with specific version and do npm install and it will install that version. Also you dont need to depend on angular-cli to develop your project.

Other thing is you can remove the latest version of angular-cli and install minor version of it. Then create the project.

Let me explain:

[STEP 0 - OPTIONAL] If you're not sure of the angular-cli version installed in your environment, uninstall it.

npm uninstall -g @angular/cli

Then, run

npm cache clean

or, if you're using npm > 5

npm cache verify

[STEP 1] Install an angular-cli specific version

npm install -g @angular/[email protected]

[STEP 2] Create a project

ng new you-app-name

The resulting white app will be created in the desired angular version.

like image 43
Rukshan Dangalla Avatar answered Nov 18 '22 09:11

Rukshan Dangalla