LoginSignup
1
2

More than 3 years have passed since last update.

Macにyarnをインストールする巻

Posted at

yarnをインストールするぞ!!!

その前にyarnって何?

Yarnは、Node.jsのパッケージマネージャーのこと。
結論から言うと、サーバーサイドのJavaScript実行環境のことらしい。

Node.jsって何?

node.jsとはサーバーサイドJavascriptのこと。
サーバーサイドでも動いたら便利になるみたい。

ほいで、パッケージマネージャーって何?

新しいソフトウェアのインストール、新しいバージョンへのソフトウェアの更新とかを簡単にさせてくる便利なヤツ。

本題に行こう

早速コマンドを生贄にyarnを特殊召喚してやる

$ brew install yarn
Updating Homebrew...

わっしょいわっしょい

🍺  /usr/local/Cellar/node/14.5.0: 4,659 files, 61.0MB
==> Installing yarn
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: An exception occurred within a child process:
  CompilerSelectionError: yarn cannot be built with any available compilers.
Install GNU's GCC: ←←←←←← ん???
  brew install gcc  

どうやらyarnを召喚するにはgccとなるものを生贄にしないといけないようだぜ。

ということで、gccを召喚する。

qiita.rb
$ brew install gcc
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/gmp-

   わっしょいわっしょい  

cannot be installed as binary package and must be built from source.  
Install the Command Line Tools: ←←←← あん???
  xcode-select --install

どうやらgccを召喚するにはxcode-selectとなるものを生贄にしないといけないようだぜ。

ということで、xcode-selectを召喚する。

qiita.rb
 $ xcode-select --install
xcode-select: note: install requested for command line developer tools

もういっちょ、gccを召喚する。

qiita.rb
$ brew install gcc      

わっしょいわっしょい

==> Downloading https://homebrew.bintray.com/bottles/gmp-
==> Pouring gcc-10.1.0.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/gcc/10.1.0: 1,463 files, 338.5MB

待ちに待ったyarnを召喚して、滅びのバーストストリームを放つ

qiita.rb
$ brew install yarn     
==> Downloading https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz

わっしょいわっしょい

🍺  /usr/local/Cellar/yarn/1.22.4: 14 files, 5MB, built in 2 seconds

大勝利

qiita.rb
 $ yarn -v
1.22.4
1
2
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
1
2