I've installed Angular-CLI using this command
npm install -g @angular/cli
but I've realized that it has installed Angular v5.1.3 but I need to use Angular 4.x.
How can I install the last version of Angular-CLI with the last version of Angular 4.x?
you can use
npm i @angular/[email protected] -g
if you want package JSON file with the versions lower than 5.
Starting with v1.5 of the Angular CLI, we have added support for Angular v5.0.0 and will generate v5 projects by default. see link
You can use a simple hack: locally install @angular/[email protected]
and use it to generate a new project.
To do that, follow these steps:
npm init
npm install @angular/[email protected]
node_modules
folders: this means that you will need to delete package.json
and any other that it has may be created like karma.js
etc.ng new <project name>
. It will use the local version of angular-cli previously installed.node_modules
folder.Then, if you cd
in your new project you will have a fully Angular 4 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