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
Release: 2024-11-12 03:11:01
Original
973 people have browsed it

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
Copy after login

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

composer require refinery29/test-util:0.10.2
Copy after login

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!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template