LoginSignup
16
12

More than 3 years have passed since last update.

ubuntu 18.04 にyarn をインストールする

Posted at

yarnの公式サイト
https://yarnpkg.com/ja/docs/install#alternatives-stable
に書かれている通り

$ curl -o- -L https://yarnpkg.com/install.sh | bash

を実行したがSSL署名がうまくいかなかった。
-kコマンドを付与して証明を無視させたがこれでもダメだった。

対策

まずYarnのレポジトリを有効化する。レポジトリのGPGキーをcurlコマンドを使って取得する。(debianはubuntuと互換性がある)

$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

次にYarnのAPTパッケージレポジトリを自分のシステムに追加する。 teeコマンドを使って書き込み。

$ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

レポジトリがシステムに加えられたらパッケージリストをアップデートしてからYarnをインストールする

$ sudo apt update
$ sudo apt install yarn

Yarnのバージョンを確認

$ yarn --version

参考

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