実行環境
OS | macOS Ventura 13.5 |
---|---|
shell | zsh 5.8.1 (x86_64-apple-darwin21.0) |
middleware | homebrew(4.1.5) |
asdf(v0.11.3) |
本記事で得られる結果
- nodejs12系の実行環境
参考資料
GitHub - asdf-vm/asdf-nodejs: Node.js plugin for asdf version manager
事前準備
- Homebrewがインストール済みであること
- asdfがインストール済みであること
手順
-
nodejsのインストールにはasdfのプラグインが必要
1-1. 今回はasdf-nodejsをインストールする必要がある
-
asdf-nodejsが依存しているツール群のインストール
brew install gpg gawk
Note: 適宜PATHを通す必要があるものは実施してください。
-
asdf-nodejsのインストール
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
-
インストール可能なnodejsバージョンの確認
asdf list all nodejs
-
nodejsのインストール
asdf install nodejs 12.22.12
-
nodejsの適用
asdf global nodejs 12.22.12
-
nodejsのバージョン確認
node -v v12.22.12
おまけ
-
npmバージョン確認
npm -v 6.14.16
-
yarnのインストール
$ npm install --global yarn