How to install a specific version of package using Composer?

gdaras picture gdaras · Dec 1, 2016 · Viewed 317.5k times · Source

I am trying to install a specific version of a package using Composer. I tried composer install and composer require but they are installing the latest version of the package. What if I want an older version?

Answer

alucic picture alucic · Jan 17, 2017

composer require vendor/package:version

for example:

composer require refinery29/test-util:0.10.2