Install specific version of ng cli

AngularNpmAngular Cli

Angular Problem Overview


I'm using angular 2.4.9 for my application development so I need to use specific version of ng cli instead of the latest one.

I know the below command will install latest version of ng cli

npm install -g @angular/cli

But how can I install specific version of ng cli?

Angular Solutions


Solution 1 - Angular

This command would install the 1.0.0 version:

npm install -g @angular/cli@1.0.0

You can see the available versions with the following command:

npm view @angular/cli

NB: You can also install the latest available version:

npm install @angular/cli@latest

Solution 2 - Angular

npm install -g @angular/cli@{version-number}

Solution 3 - Angular

In case anyone stumbles on this question while looking for a way to use angular-cli to build Angular 2 apps, @angular/[email protected] generated apps installs angular 4.0.0 instead of 2xx.

To avoid the round-trip of uninstalling the cli and looking for the most recent version that builds 2xx, use @angular/[email protected]

It builds Angular 2.4.1 ;)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBuddybearView Question on Stackoverflow
Solution 1 - AngularPloppyView Answer on Stackoverflow
Solution 2 - AngularNwekeView Answer on Stackoverflow
Solution 3 - AngularNnanyielugoView Answer on Stackoverflow