How do I decide whether to use NPM or Bower to install dependencies?
e.g. What's the difference between npm install requirejs --save-dev
and bower install requirejs --save-dev
?
Is there a 'best practice', or any way to choose?
Are there any others that I need to be aware of?
Use bower for front-end dependencies and NPM for server side.
NPM is more geared for server side libraries, but, can be used for front end. Bower was created for front end libraries.
Also NPM uses a nested dependency tree which has a much bigger footprint, while bower uses a flat dependency tree.
Also, bower will force you to only have a single version of a library, while NPM will let you have multiple versions.