A
A
Alexander Taratin2015-10-17 00:19:33
JavaScript
Alexander Taratin, 2015-10-17 00:19:33

Why do you need a bower?

Why do you need a bower?
Essentially a heavily stripped-down npm? Or not?
Here they write
https://xakep.ru/2014/05/30/bower-package-manager/


The main difference between npm and Bover is the approach to installing package dependencies. Npm installs the dependencies for each package separately, in the folder of this package, then installs the dependencies of the dependencies in the same way, and so on. In client-side javascript, this is not allowed: you cannot include two versions of jQuery or any other library on a page. In Bover, each package is installed once, and in the event of a dependency conflict, Bover will simply not install a package that is incompatible with those already installed.

But in the same npm, when building through browserify, packages of the same versions will be included in the resulting file once. Or you can immediately register duplicate packages as dependencies of the parent / main package, then they will be installed once.
In short, what is the point of other package managers besides npm?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2015-10-17
Protko @Fesor

In short, what is the point of other package managers besides npm?

npm is a package manager for node.js while bower is purely for the browser. There are people (like me) who are categorically FOR such a division. There is also jspm and I hope that someday I will switch to it. Again, the approach that npm uses for the frontend is certainly fine, but there are caveats.
And everything would be cool if not for one thing: the bower is miserable, no matter how much I love him. It's been half a year since they can't lock dependency files... it's sad.... Well, npm is developing. Google npm dedup, so that the overhead from each module using its own modules is reduced to zero.

K
Konstantin Kitmanov, 2015-10-17
@k12th

The beauty of bower is the ability to put dependencies where you need them, and not in node_modules. This is irreplaceable on legacy projects, for example.
On the other hand, if you use, for example, momentjs on the server and on the client, or you have isomorphic rendering on react, then you won’t set the same thing twice with two different managers.

D
Deodatuss, 2015-10-17
@Deodatuss

npm downloads every time all the dependencies, that is, there can be 100 identical downloaded libs in the project. and bower pumps only what is not there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question