Can I select the version of Angular when creating a new project?

Viewed 1055

Is it possible to select Angular version when creating a new project? That is, I have installed globally Angular 8 , and I want to create a project on Angular 7. How can this be done without updating all the Angular modules in turn (example: npm i @angular/animations@7, etc.)?

3 Answers

You can create a new folder and install angular 7 in it.

npm install @angular/cli@7.0.0

Note: Do not use -g (This is for global installation)

When you will create a new project in that folder with ng new, the version of the app will be 7.

you can create a local Angular-cli environnement

  • create a new folder and navigate inside
  • run the command: npm init
  • install your cli version: npm install @angular/cli@7 enter image description here
  • remove package.json file and leave only your new created node_modules folder
  • ng new angularApp (this will use your local angular/cli to create your app)
  • now you have your angular app with the specific angular version and you can delete the node_modules folder that is in your environement folder enter image description here
Related