Composer vs NPM vs Bower

In every new Laravel project, lots of files are initiated and installed. Web developers will see two familiar files- composer.json & package.json. It looks similar but both are actually different.

Composer

Composer is a PHP dependency manager.
It uses Packagist to get information on dependencies and install them properly for you. Important if you’re doing PHP projects.

NPM

NPM is NodeJS package manager.
It is part of the Node ecosystem and was primarily built to manage the dependencies for Node.js applications. However, as Node became more popular people started using NPM not just for Node.js modules. It is now the quasi-standard to manage your JavaScript dependencies.

Bower

Bower is a front-end package manager.
Interestingly, you need to install npm in order to install Bower, but it’s not a part of the Node ecosystem. Bower manages HTMl/CSS/JS dependencies.

So which do I need?

Composer is for PHP packages, NPM and Bower for JavaScript packages. You probably need all of it if you’re doing Laravel. Wouldn’t it be nice to have a centralized package/dependency manager for all?

And oh my god…don’t get me started on gulp, grunt, homebrew, webpack, yarn.
I can’t imagine how lost one might be when starting out their web development career.