I am using angular-cli to scaffold a new Angular2 project with ng new project_name
. It takes a long time to complete, as it downloads all dependencies each time ng new
is run. Is there a way to create subsequent new projects without having to re-download all the dependencies?
Just run ng new myproject with the latest version of @angular/cli. The result is: "added 1457 projects in 287.624 seconds"..
Installing Angular with the CLI is not a complicated process. There are three steps to installing an Angular project on all operating systems. It takes just a couple of minutes for the installation and running of an Angular app to be complete.
reason: In the Angular 12 version, run ng build, and now the default is production mode. This is a welcome change because it reduces the chance of inadvertently deploying a development build to a production environment, which is much slower and much larger, making it feel like Angular is very slow.
You can use ng new project_name --skip-install
or ng init project_name --skip-install
to not download all the additional packages right away. You could then copy the node_modules directory from an existing project template, and finally do an npm install
or yarn install
to make sure everything is happy, depending on your package manager.
Previous versions use ng new project_name --skip-npm
or ng init project_name --skip-npm
It is by far faster to use:
ng new myProject --skip-install=true cd myProject npm install
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