9
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Composerを1系から2系にアップデートする

Last updated at Posted at 2021-02-26

はじめに

作業PCにインストールしているComposerを1系から2系にアップデートしたので、その備忘録です

現在のバージョン

$ composer -V
Composer version 1.10.10 2020-08-03 11:35:19

アップデートする

composer self-update だと、1系の最新バージョンになるので、後述するコマンドでアップデートする

$ composer self-update
A new stable major version of Composer is available (2.0.11), run "composer self-update --2" to update to it. See also https://github.com/composer/composer/releases for changelogs.
Updating to version 1.10.20 (1 channel).
   Downloading (100%)         
Use composer self-update --rollback to return to version 1.10.10
$ composer -V
Composer version 1.10.20 2021-01-27 15:41:06

composer self-update --2 で2系にアップデートする

$ composer self-update --2
Updating to version 2.0.11 (2.x channel).
   Downloading (100%)         
Use composer self-update --rollback to return to version 1.10.20
$ composer -V
Composer version 2.0.11 2021-02-24 14:57:23

2系から1系に戻す

$ composer self-update --rollback
Rolling back to version 2021-01-27_15-41-06-1.10.20.
$ composer -V
Composer version 1.10.20 2021-01-27 15:41:06

まとめ

Composer2系になったことで変わったことはこちらでまとまっているので参考にしてみてください

9
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?