Home / Snippets / How to Switch PHP Composer Versions
How to Switch PHP Composer Versions cover

How to Switch PHP Composer Versions

226

3 years ago

0 comments

Sometimes you might need to change your composer version to meet the requirement of the project you are working on. But how to do that and is it even possible? The answer is yes it's possible and below are the commands to switch between composer versions 1 and 2.

Switch Composer to Version 1
If you are currently on version 2 then you can run the command like below to change to version one.
composer self-update --1

Switch Composer to Version 2
Otherwise, if you are already on version 1 then you can specify the version 2.
composer self-update --2

Do note that the "--1" or "--2" version flag is necessary to indicate the version you are switching into.

Switch to Specific Version Number
To switch the version to a specific one you can pass on the exact version number as required like below.
composer self-update 1.10.22
composer self-update 2.1.3
notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this