Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to install a specific version of a software package with Composer

Shulou Source: shulou.com Published: 2022-06-02 11:17:47 10月03日 Update

This article will explain in detail how to use Composer to install a specific version of the software package, Xiaobian feels quite practical, so share it with you as a reference, I hope you can gain something after reading this article.

This is a short quick article on how to install a specific version of a package using Composer

TL;DR version

composer require vendor/package:version//Examplecomposer require laravel/passport:6.0

detailed edition

Navigate to the project root directory at the terminal and install a specific version of the package using Composer by executing the following command

Suppose you want to install version 6.0.0 of the larvael/passport package into your project instead of installing the latest version. Then you should execute the following command

composer require laravel/passport:6.0.0

Add double quotes to use caret or tilde operators in version numbers.

for example

composer require middlewares/whoops "^0.4"

Wave version range (~) - ~1.2.3 corresponds to>=1.2.3 =1.2.3

Tags: Versions software packages waves articles commands articles more symbols scope patches projects updates good practical short good important security content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Redmi Huawei MySQL Xiaomi