18
16

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 5 years have passed since last update.

brewでインストールしたyarnのバージョンを変更する方法

Posted at

brewでインストールしたyarnのバージョンを切り替える方法について説明します。

手順

  1. まず、すでにbrewでyarnを入れている場合はbrew unlink yarnでリンクを解除します。
  2. 次に、Pull Request that has been merged which contained the formula (version) of Yarn からインストールしたいyarnのバージョンを探します。
  3. プルリクエストで変更されたファイルには、Formula/yarn.rb のファイルが存在するはずです。
  4. 変更されたFormula/yarn.rbを"View"ボタンから確認し、ファイルを確認します。
  5. "Raw"ボタンをクリックすると、https://raw.githubusercontent.com/...で始まるURLが開きます。このURLをコピーしてください。
  6. 最後にターミナルでbrew installコマンドを、先ほどコピーしたURLを対象に実行します。例えば、yarnのv1.6.0をインストールするには、以下のコマンドを実行します。
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/fba7635ab69384ac980c635483a7af825bc06088/Formula/yarn.rb

brew list --versions yarnによってHomebrewで実行できるyarnのバージョン一覧が表示されるため、使いたいバージョンをbrew switch yarn VERSION_NUMBERで指定します。

以上です。

参考

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?