Angular-cli needs to be installed before creating project globally or locally, but as far I know every angular project has it's own node_modules with binaries and package-lock.json hence it is a complete installation itself. Today I started using npx for creating projects with temporary local angular-cli installation in cache. Afterwards it disappears and node_modules within created projects are sufficient to utilize angular-cli. Because of that I am not sure why do we need pre-installed cli. Can't angular just download packages right away and install itself with a project creation?
Asked
Active
Viewed 67 times
0
-
2`Can't angular just download packages right away and install itself with a project creation?` <= I assume you mean with `ng new`? Where would `ng` (which is a command) be located if not on the local pc? How would the O/S run it if it does not (yet) exist? – Igor Mar 25 '19 at 19:38
-
You install Angular CLI globally on your machine first. After that you will be able to issue a command ng new to create an angular project from scratch (anywhere on your machine). If you don't do that then ng new will be unrecognized command. – robert Mar 25 '19 at 20:58