yarnインストールでwarning

Warningの意味

  • 警告: あなたが使っているNodeは XXX でyarnでサポートしてないですよ。バグや予期しない振る舞いをしたりする可能性がありますよ。Yarnはこのバージョンしかサポートしてないですよ。
$ yarn
yarn install v1.5.1
warning You are using Node "7.3.0" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0"
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
info Lockfile not saved, no dependencies.
✨  Done in 0.13s.

最新版をインストールしたはずだけど?

==> Installing yarn dependency: node
==> Downloading https://homebrew.bintray.com/bottles/node-9.10.1.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring node-9.10.1.el_capitan.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/node/9.10.1: 5,125 files, 49.8MB

原因: ndenvのほうのnodeを見ていた

  • which でどのnodeを見ているか確認
$ which node
/Users/kz-engineer/.anyenv/envs/ndenv/shims/node

解決

  • ndenvのほうで最新版をインストールして、バージョンを切り替え
$ ndenv install v9.10.1
$ ndenv global v9.10.1
  • 消えた
$ yarn
yarn install v1.5.1
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
info Lockfile not saved, no dependencies.
✨  Done in 0.06s.