10
Can someone explain to me the difference between NPM, Bower and Composer.
They are all package managers, correct?
But when each must be used?
10
Can someone explain to me the difference between NPM, Bower and Composer.
They are all package managers, correct?
But when each must be used?
17
Yes correct, they are all package managers. But, the type of packages they manage is different.
I can begin by explaining that Composer is a package manager focused on php (there are exceptions, for example you can also "install" jQuery but by convention and by habit people tend to choose Bower for this specific effect), if you internalize that Composer is for php (although there are exceptions) you will not make a fuss. While others are not for php packages.
As for the others they can be confused, yes, but I will try to make them cease to be.
Npm is mostly for managing Node.js packages/modules, it has some exceptions but usually these have the possibility to choose which to use, eg: https://vuejs.org/v2/guide/installation.html .
Bower is used to manage front-end packages, such as html, css (eg, bootstrap, etc.), javascript (e.g. Jquery, etc.), anything related to layout (code only interpreted by the browser, browser, not the server), often even entire templates can be downloaded with Bower, e.g. https://github.com/almasaeed2010/AdminLTE.
10
composer
is for PHP packages (although it is possible to install more than PHP, you can even install things like bootstrap and jQuery) and it installs packages available on https://packagist.org
How to create and publish a package /a/102747/3635
npm
for node.js
and installs packages available on https://npmjs.com/
How to create and publish a package https://docs.npmjs.com/getting-started/publishing-npm-packages
the bower
serves mainly for front-end packages, but there are exceptions
How to create and publish a package https://bower.io/docs/creating-packages/
9
NPM
is for projects in nodejs, if you are developing some project with Nodejs the best option is this.
Bower
is for web project dependencies, focused on front-end, like jQuery (Bower needs nodejs to run)
and the Composer
is a PHP-focused dependency manager.
There is another link in stackoverflow in English, where someone explains the difference a little better, follow the link: https://stackoverflow.com/questions/22918517/npm-bower-composer-differences
With Composer it is also possible to install dependencies, such as jQuery. It is focused on PHP, but can be used with other things .
@Wallacemaxters as I quoted in my reply ;)
@Guilhermenascimento, in fact it is true was sure that it was only php, apparently it was wrong :/... My mistake, and mine was accepted and not deserved
@Miguel not the problem Miguel, all answers were helpful, you can edit your and add the detail without problem, as long as you help the community see no problem ;)
Obagdo for letting me correct the reply @Guilhermenascimento, with information provided by you
5
npm is the nodejs package manager. Used in javascript projects and takes care of the javascript module dependencies of your project. See more on npmjs
commiserate is the backend package manager, most used in PHP, but there are other projects and CMS like drupal that Composer takes care of all the module dependency of the project. See more in commiserate
Bower is a front-end component manager, it is necessary to put it with npm. It manages the front-end dependencies of your project. See more in Boer.io.
Browser other questions tagged commiserate npm bower
You are not signed in. Login or sign up in order to post.
Is excellent +1
– Guilherme Nascimento