Node.js
公式サイト
インストール
nodeのバージョン管理ツールを利用する事を推奨
個人的には以下のいずれかがお勧め
- mise https://github.com/jdx/mise : 旧rtx。nodeだけでなく、goやrust等も管理できる統合管理ツール。いろいろ管理したい人はこれ
- nvm https://github.com/nvm-sh/nvm : node だけを管理したい人はこれ。メンテちゃんとされており、情報も多め
ほかの物も一応利用した事があるのでメモ
https://github.com/shadowspawn/node-version-usage
- volta https://github.com/volta-cli/volta なかなか便利だが、メンテが滞っている
- nodebrew https://github.com/hokaccha/nodebrew 自分には合わなかった
- nodenv https://github.com/nodenv/nodenv 自分には合わなかった
- n https://github.com/tj/n 別にnvmで良いかな......
- fnm https://github.com/Schniz/fnm 自分には合わなかった
mise
とりあえず自分はmiseを利用している
-
mise ls-remote node
lts
mise install node@lts
最新
mise install node@latest
バージョン指定
mise install node@20.11.0
mise where node mise where npm
mise use -g --pin node@lts
~/.config/mise/config.toml に書き込まれる
mise which node
mise settings set experimental true
mise use -g npm:prettier
prettier --version
他の環境で同期
# 設定をする
~/.config/mise/config.toml
# 設定に合せてinstall
mise install
