Home > Backend Development > PHP Tutorial > How to Install a Specific Package Version with Composer?

How to Install a Specific Package Version with Composer?

DDD
Release: 2024-11-10 12:29:02
Original
349 people have browsed it

How to Install a Specific Package Version with Composer?

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

where:

  • vendor/package is the name of the package you wish to install.
  • version is the specific version you want to install.

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

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!

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template