Common Problems & Solutions for Working with Composer

greg.1.anderson

If you have been using Composer for a while now, you have probably encountered some strange problems now and again. Sometimes, Composer will fail to install or update some project, and gives only a long, cryptic list of projects and versions that it claims are in conflict, with an unhelpful recommendation to not install some project that you need. Other times, a project might install fine, but not work right--even though the same code was running perfectly on another computer just recently. A collection of workarounds are often used to address these problems. Deleting the lock file and vendor directory. Installing things in a different order. Running `composer update some/project --with-dependencies`. Trying something like this can get your project working again, but why is Composer behaving this way? In this brief session, we will examine the implications of what being a per-project dependency manager means for Composer, and how using it consistently with its intended use patterns can help avoid these problems in the first place.

Session Track

PHP

Experience Level

Intermediate

Drupal Version