Repository navigation
🔧 Node.jsの版をNodefileとnodenvで管理 - #3
Merged
Merged
Conversation
dot-request-dashboard が Node >=24.15.0 <25 (.node-version は 24.19.0) を要求するが、 手元には v26 しか無いため、プロジェクト別の Node.js の版を dotfiles で管理する。 - Nodefile を新設し、nodenv で導入する版を 1 行 1 版で列挙する (今回は 24.19.0) - lib/node.sh に ensure_node_versions を置き、各版を nodenv install --skip-existing で導入する。 nodenv 未導入ならスキップし、nodenv global は変えない - install.sh の all フローと新しい MODE node から呼ぶ - fish / zsh / bash の PATH 設定で ~/.nodenv/shims を先頭に置く。 .node-version の無い場所では nodenv の system 解決で従来の /opt/homebrew/bin/node が使われる - docs/architecture.md と pkg-add skill に Nodefile を追記 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目的
~/agent/projects/dot-request-dashboardは Node>=24.15.0 <25(.node-versionは24.19.0)を要求するが、手元には v26 しかない。グローバルに入れる Node.js の版を dotfiles で管理し、.node-versionを置くプロジェクトでだけ切り替わるようにする。変更内容
Nodefileを新設。1 行 1 版、#行はコメント。今回は24.19.0(dot-request-dashboard 用)lib/node.shにensure_node_versionsを追加。Nodefileの各版をnodenv install --skip-existingで導入する。nodenv 未導入ならスキップし、nodenv globalは変えないinstall.shで source し、allフロー(Terraform の直後)と新しい MODEnodeから呼ぶ。未知 MODE のエラー文の一覧にもnodeを追加.config/fish/config.fish)、zsh(.config/zsh/zshenv/zprofile)、bash(.config/bash/bash_profile)の既存の PATH 設定で~/.nodenv/shimsを先頭に置くdocs/architecture.md(構成図、MODE 表、PATH 管理の節)と.claude/skills/pkg-add/SKILL.md(種別表、Nodefile 小節)に追記確認結果
./lint.sh通過(ShellCheck / fish / tmux / Spotlight / TOML / JSON / plist)NODENV_ROOTを向けてensure_node_versionsを 2 回実行し、1 回目で24.19.0を導入、2 回目は skip されることを確認NODENV_ROOTの shims を PATH 先頭に置いた状態でnode -vを確認.node-versionnodenv version-namenode -v~/agent/projects/dot-request-dashboard24.19.024.19.0~system/opt/homebrew/bin/node)system/opt/homebrew/bin/node)~/agent/projects/clinial-co-jp22nodenv: version '22' is not installed注意
~/agent/projects/clinial-co-jp/.node-versionが22のため、shims を入れるとそこでnodeが未導入エラーになる。nodenv の版解決はversions/<name>ディレクトリの完全一致で、22のような部分指定は解決しない。対応は PR とは別に判断する(候補:.node-versionを完全な版番号にしてNodefileに追加する、など)。merge 後の適用(live 環境の変更、ユーザー確認後に実行)
zsh / bash の PATH 設定(
~/.zshenv/~/.zprofile/~/.bash_profile)は./install.sh(all)の設定ファイルコピーで反映される。🤖 Generated with Claude Code