I searched through google and angular cli doc but couldn't find any way to install a specific version of Angular using Angular CLI. is it even possible?
To answer your question, let's assume that you are interested in a specific angular version and NOT in a specific angular-cli version (angular-cli is just a tool after all).
A reasonnable move is to keep your angular-cli version alligned with your angular version, otherwise you risk to stumble into incompatibilities issues. So getting the correct angular-cli version will lead you to getting the desired angular version.
From that assumption, your question is not about angular-cli, but about npm.
Here is the way to go:
[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 (--force flag might be required)
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.
NOTE: I have not found any page displaying the compatibility matrix of angular and angular-cli. So I guess the only way to know what angular-cli version should be installed is to try various versions, create a new project and checkout the package.json
to see which angular version is used.
angular versions changelog Here is the changelog from github reposition, where you can check available versions and the differences.
Hope it helps
You can just have package.json
with specific version and do npm install
and it will install that version.
Also you don't need to depend on angular-cli
to develop your project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With