How to Create a specific version of Angular Project using CLI?

后端 未结 5 376
南方客
南方客 2020-12-24 01:40

My npm version is 5.5.1 and angular cli version is 6.2.1. When I try to create a new project using the command ng new Project_name<

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-24 02:10

    The Easy Way: example:npm install -g @angular/cli@6 here the -g flag tells npm to do this install globally. The 6 on the end tells npm that I want the latest available version 6.

    if I want to create a new application for Angular 5 I do this :

    > npm install -g @angular/cli@1
    > ng new my-ng5-app
    

    Remember, Angular CLI was version 1.7 for Angular 5.

    if I want to create a new application for Angular 6 I do this :

    > npm install -g @angular/cli@6
    > ng new my-ng6-app
    

    if I want to create a new application for Angular 7 I do this :

    > npm install -g @angular/cli@7
    > ng new my-ng7-app
    

    I hope it would be helpful for you thanks....!

    read full blog click here

提交回复
热议问题