fnm (Node.js バージョンマネージャー)を試す
Rust 製の Node.js バージョンマネージャー。
類似のものとしては nodenv や nvm とかがあると思う。
Setup
code:bash
Downloading fnm using Homebrew...
Checking dependencies for the installation script...
Checking availability of curl... OK!
Checking availability of unzip... OK!
Checking availability of Homebrew (brew)... OK!
Updating Homebrew...
==> Tapping schniz/tap
Cloning into '/usr/local/Homebrew/Library/Taps/schniz/homebrew-tap'...
remote: Enumerating objects: 103, done.
remote: Counting objects: 100% (103/103), done.
remote: Compressing objects: 100% (52/52), done.
remote: Total 146 (delta 47), reused 69 (delta 24), pack-reused 43
Receiving objects: 100% (146/146), 17.76 KiB | 3.55 MiB/s, done.
Resolving deltas: 100% (64/64), done.
Tapped 1 formula (30 files, 50.5KB).
Installing for Bash. Appending the following to /Users/hyiromori/.profile:
# fnm
export PATH=/Users/hyiromori/.fnm:$PATH
eval "fnm env --multi"
In order to apply the changes, open a new terminal or run the following command:
source /Users/hyiromori/.profile
後は、環境変数とかを表示通りに設定する。
使い方
公式のGIF動画見るのが早い。
.node-version を見て fnm install でインストールしてくれるのはいいな。
https://github.com/Schniz/fnm/raw/master/docs/fnm.svg