Installing a Specific Package Version with Composer
When attempting to install a package using Composer, the default behavior is to install the latest stable version. However, there are instances where you may need to install an older or a specific version of a package. This guide will demonstrate how to install a specific package version using Composer.
Installing a Specific Package Version
To install a specific version of a package, use the following syntax:
composer require vendor/package:version
where:
For example, to install version 0.10.2 of the refinery29/test-util package, you would run the following command:
composer require refinery29/test-util:0.10.2
By utilizing this approach, Composer will install the specified version of the package, regardless of whether there is a newer version available.
The above is the detailed content of How to Install a Specific Package Version with Composer?. For more information, please follow other related articles on the PHP Chinese website!