Home >Backend Development >PHP Tutorial >How Can I Install a Specific Version of a Composer Package?

How Can I Install a Specific Version of a Composer Package?

Patricia Arquette
Patricia ArquetteOriginal
2024-11-12 03:11:011004browse

How Can I Install a Specific Version of a Composer Package?

Installing Specific Composer Package Versions

When utilizing Composer for dependency management, you may encounter situations where you require a specific version of a package. By default, Composer tends to install the most recent version of a package unless explicitly specified.

To install a specific package version, employ the following syntax:

composer require vendor/package:version

For instance, to install version 0.10.2 of the 'refinery29/test-util' package:

composer require refinery29/test-util:0.10.2

This command will install the specified version of the package, ensuring that your project utilizes the desired functionality and compatibility level.

The above is the detailed content of How Can I Install a Specific Version of a Composer Package?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn