Skip to content

🔧 Node.jsの版管理をnodenvからmiseに切替 - #4

Merged
u-ichi merged 1 commit into
mainfrom
u-ichi/switch-node-manager-to-mise
Oct 6, 2026
Merged

u-ichi merged 1 commit into
mainfrom
u-ichi/switch-node-manager-to-mise

Conversation

@u-ichi

@u-ichi u-ichi commented Oct 6, 2026

Copy link
Copy Markdown
Owner

目的

PR #3 で導入した nodenv は .node-version の 22 のような系列指定を解決できず(~/.nodenv/versions/<名前> の完全一致のみ)、clinial-co-jp(.node-version = 22)と cohort-explorer(.nvmrc = 22)で node が未導入エラーになる。repo ごとの版指定(.node-version / .nvmrc、系列指定を含む)に対応するため、版管理を mise に切り替える。

変更内容

対象 変更
Brewfile brew 'nodenv' を外し brew 'mise' を追加
.config/mise/config.toml(新設、copy.conf で ~/.config/mise/config.toml へ) idiomatic_version_file_enable_tools = ["node"](mise は .node-version 等を既定で読まない)、not_found_auto_install = false(版の導入は Nodefile 経由に限定)
Nodefile 各行を mise install node@<版> に渡す。24.19.0(dot-request-dashboard)と 22(clinial-co-jp、cohort-explorer)を列挙
lib/node.sh nodenv install --skip-existing を mise install node@<版> に変更。mise 未導入ならスキップ
fish / zsh / bash の PATH ~/.nodenv/shims を ~/.local/share/mise/shims に置換
docs/architecture.md、.claude/skills/pkg-add/SKILL.md nodenv の記述を mise に更新

shims 方式のまま(mise activate は使わない)にしたのは、zsh の対話設定 ~/.zshrc を dotfiles が管理しておらず、script からの node 実行にも同じ解決を効かせるため。版指定の無い場所では mise の shims が PATH 上の次の node(Homebrew の v26.7.0)へ fallback する(mise docs の not_found_system_fallback、既定 true)。

確認結果

  • ./lint.sh 通過(ShellCheck / fish / tmux / Spotlight / TOML / JSON / plist)
  • mise は手元に未導入のため、実機での版解決は merge 後の適用時に確認する(dot-request-dashboard で v24.19.0、clinial-co-jp と cohort-explorer で 22.x、版指定の無い場所で v26.7.0)

merge 後の適用(live 環境の変更、ユーザー確認後に実行)

git -C ~/agent/projects/dotfiles pull
~/agent/projects/dotfiles/install.sh brew mise   # mise の導入
~/agent/projects/dotfiles/install.sh node        # Nodefile の版を mise install
~/agent/projects/dotfiles/install.sh fish        # fish の PATH 設定を再コピー
cp ~/agent/projects/dotfiles/.config/mise/config.toml ~/.config/mise/config.toml
cp ~/agent/projects/dotfiles/.config/zsh/zshenv ~/.zshenv
cp ~/agent/projects/dotfiles/.config/zsh/zprofile ~/.zprofile
cp ~/agent/projects/dotfiles/.config/bash/bash_profile ~/.bash_profile

nodenv の撤去(brew uninstall nodenv node-build、~/.nodenv の削除)は brew bundle では行われないため、ユーザーの操作として別途行う。

🤖 Generated with Claude Code

nodenv は .node-version の `22` のような系列指定を解決できず、clinial-co-jp
(.node-version = 22) や cohort-explorer (.nvmrc = 22) で node が未導入エラーになる。
repo ごとの版指定 (.node-version / .nvmrc、系列指定を含む) に対応するため mise に切り替える。

- Brewfile: nodenv を外し mise を追加
- .config/mise/config.toml を新設 (copy.conf で ~/.config/mise/config.toml へ)。
  idiomatic_version_file_enable_tools = ["node"] で .node-version / .nvmrc を読み、
  not_found_auto_install = false で版の導入を Nodefile 経由に限定する
- Nodefile: 各行を `mise install node@<版>` に渡す。24.19.0 と 22 を列挙
- lib/node.sh: nodenv install --skip-existing を mise install に変更
- fish / zsh / bash の PATH: ~/.nodenv/shims を ~/.local/share/mise/shims に置換。
  版指定の無い場所では shims が Homebrew の node へ fallback する
- docs/architecture.md と pkg-add skill の nodenv の記述を mise に更新

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@u-ichi
u-ichi merged commit 65bc623 into main Oct 6, 2026
1 check passed
@u-ichi
u-ichi deleted the u-ichi/switch-node-manager-to-mise branch October 6, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant