プロジェクトの直下に.tool-versions
が存在していたらasdfを使っているかと思いますので、素直にインストールしましょう。
環境
- M2Mac
- Homebrew
- ZSH
インストール
公式 に従って進めます
brew install coreutils curl git
brew install asdf
echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc
既存プロジェクトのnodejsを設定する
$ cat .tool-versions
nodejs 20.12.0
brew install gpg gawk
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
asdf install
トラブルシューティング
Xcodeが古くてエラーが出る
Error: Your Xcode (11.1) at /Applications/Xcode.app is too outdated.
Please update to Xcode 15.1 (or delete it).
Xcode can be updated from the App Store.
→AppStoreからXcodeをインストールする