composer升级composer 2和降级

在实际的项目开发中,有的旧项目用的是 composer 旧版本,而新项目需要使用 composer2,这里涉及到升级降级的问题,参考下面:

升级到 composer2

(base) PS C:\laragon\composer> composer self-update --2
Updating to version 2.7.8 (2.x channel).
   Downloading (100%)
Use composer self-update --rollback to return to version 1.10.26
(base) PS C:\laragon\composer> composer -v
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 2.7.8 2024-08-22 15:28:36

降级

PS C:\laragon\composer> composer self-update --1
Warning: You forced the install of 1.10.27 via --1, but 2.7.8 is the latest stable version. Updating to it via composer self-update --stable is recommended.
Upgrading to version 1.10.27 (1.x channel).

Use composer self-update --rollback to return to version 2.7.8

这样就强制降级到版本1了。

标题:composer升级composer 2和降级

原文链接:https://beltxman.com/4331.html

若无特殊说明本站内容为 行星带 原创,未经同意请勿转载。

发表评论

您的电子邮箱地址不会被公开。

Scroll to top