16
4

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 self-update で Command "self-update" is not defined. と表示される場合

Last updated at Posted at 2021-01-31

composer self-update で Command "self-update" is not defined. と表示される場合の対処の仕方です。

まずは apt 系で入っている場合は削除します。

sudo apt-get remove composer;

次に、公式サイトからのインストールスクリプトのダウンロードを行います。

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');";

/usr/binにcomposerをインストールを行います。

sudo php composer-setup.php --install-dir=/usr/bin --filename=composer;

これで composer self-update が使用できるようになります。

composer self-update;

※追記
インストール先を/usr/local/binと記述していました。正しくは/usr/binになります。
お知らせありがとうございますm(_ _)m

16
4
2

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
16
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?