ndenvインストール
git clone https://github.com/riywo/ndenv ~/.ndenv
brew install ndenv
echo 'export PATH="$HOME/.ndenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(ndenv init -)"' >> ~/.bash_profile
git clone https://github.com/riywo/node-build.git $(ndenv root)/plugins/node-build
ndenvによるnodeのインストール
ndenv install -l
ndenv install v12.6.0
ndenv global v12.6.0
ndenv versions
ndenv rehash
指定したバージョンのパスを通す。通さないとnpm installでインストールしたモジュールのパスがないため、コマンドが実行できないため。
echo 'export PATH="$HOME/.ndenv/versions/v12.6.0/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
node -v
yarn インストール
npm install -g yarn