delta’s diary

プログラミングとか

node環境を作ったけどあってるかわからない

nodeのversion管理にnodenvを使う。

$ brew install nodenv

lts版のnodeをinstallする

$ nodenv install 10.15.3
$ nodenv global 10.15.3

.zshrcにPATHとinitを追加する。

export PATH="$HOME/.nodenv/bin:$PATH"
eval "$(nodenv init -)"

yarnをインストールする。公式のページを見るとnvm関係を使ってる人は以下のコマンドを実行してください、と書いてあるのでコピペした。

$ brew install yarn --ignore-dependencies
Updating Homebrew...
Warning: --ignore-dependencies is an unsupported Homebrew developer flag!
Adjust your PATH to put any preferred versions of applications earlier in the
PATH rather than using this unsupported flag!

==> Downloading https://yarnpkg.com/downloads/1.16.0/yarn-v1.16.0.tar.gz
==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws
######################################################################## 100.0%
🍺  /usr/local/Cellar/yarn/1.16.0: 14 files, 4.7MB, built in 6 seconds

なんか依存関係が不安。。。ダメそうだったらやり直そう。