NPM and Bower are functionally coincident, but not mutually exclusive, and can be used simultaneously in the project. The difference is that NPM adopted a nested dependency tree at the beginning of the design. A common front-end package has a long dependency tree, and NPM will download the development environment together and not share the dependency code with other installation packages. resulting in a very great number of files, this way is obviously unfriendly to the front end, not suitable for front-end code deployment. Bower uses a flat dependency management approach, bower only download the post-compilation pre-module, using more in line with the use of front-end development habits.
NPM belongs to the manager of the node module. While Bower is the front-end module management, NPM is primarily used for the internal dependency management of node. JS projects, and the installed modules are located in the Node_modules folder under the project root directory. While Bower is used for front-end development in most cases, dependency management on content such as css/js/templates can be customized for the dependent download directory structure.
In a real-world project, we can use NPM management-dependent packages on the backend, using a combination of bower management-dependent packages in the front-end. While the front-end common development language, the different end of the development engineer can better use the tools on hand to improve development efficiency.
The difference between NPM and Bower