In angularjs 2 what is main difference between NPM and NG (anglular-cli). If By NPM if we can built our application and it will work then what is the need of NG Built (angular-cli).
npm start vs ( ng serve or ng built)
NPM is basically a package manager which acts as a dependency provider. Similarly, YARN is another such example. NPM contains and manages many packages and modules, and NG is one such module which is a core module of Angular.
ionic build uses ng build internally. If you run ng build directly, Ionic hooks won't be triggered as it is bypassed. npm run build picks the "build" from package. json which is the same as ng build .
The Angular Framework, Angular CLI, and components used by Angular applications are packaged as npm packages and distributed using the npm registry. You can download and install these npm packages by using the npm CLI client, which is installed with and runs as a Node. js® application.
Angular CLI is a command line interface for writing or easily setting/building up an angular application. Angular js - is a older version of Angular (version 1. x) which is a open-source JavaScript-based front-end web application framework.
NPM is basically a package manager which acts as a dependency provider. If there are many small packages, required to build a large one, NPM is the one hotspot which will provide us with the packages. Angular-CLI is one of those packages. As far as NG is concerned, it is the core module of Angular. Whenever, an application is started,the NG module is loaded by deafult. The module itself contains the essential components for an AngularJS application to function.
Hope it helps!
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