fix: nvm lazy load で claude CLI が動作しない問題を修正 - #664
Conversation
node/npm/npx のシェル関数ラッパーを廃止し、nvm の最新インストール済み バージョンの bin ディレクトリを PATH に即座に追加する方式に変更。 nvm alias の再帰的解決(default → node → 実バージョン)が不要になり、 #!/usr/bin/env node を使う CLI ツール(claude 等)が正常に動作する。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughModified shell initialization in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 AI Code Review (Local Hook)Models: Codex (default) / Gemini (default) 🤖 Codex Review指摘事項:
判定: patch is incorrect
|
|
Claude finished @keito4's task in 1m 25s —— View job PR レビュー結果: ❌ REQUEST_CHANGES
概要アプローチの方向性( 🔴 Major:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8cb7ffc1e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # nvm 本体の初期化のみ遅延させる | ||
| if [ -d "$NVM_DIR/versions/node" ]; then | ||
| # 最新のインストール済みバージョンを使用 | ||
| NODE_BIN=$(ls -d "$NVM_DIR/versions/node"/*/bin 2>/dev/null | sort -V | tail -1) |
There was a problem hiding this comment.
Honor nvm default version when priming PATH
Selecting NODE_BIN via sort -V | tail -1 always chooses the highest installed Node, not the user's nvm alias default. In environments with multiple installed versions (for example default pinned to an LTS for project compatibility while a newer major is also installed), this makes node/npm and #!/usr/bin/env node tools run with the wrong runtime until nvm is explicitly invoked, which is a behavioral regression from the prior lazy-loader wrappers.
Useful? React with 👍 / 👎.
|
🎉 This PR is included in version 1.108.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
概要
PR #662 の nvm 遅延読み込みで
claudeCLI が起動できなくなった問題を修正。原因
node/npm/npxをシェル関数でラップ →#!/usr/bin/env nodeから見えないdefault→node(シンボリック名)を直接バージョンと解釈 → パスがvnode/binになり不正修正内容
ls | sort -V | tail -1で最新バージョンの bin を PATH に追加node/npm/npxのシェル関数ラッパーを廃止(バイナリを直接使用)nvmコマンドのみ遅延読み込みを維持テスト
claude --version→2.1.91 (Claude Code)node --version→v24.4.0time zsh -i -c exit→ 0.37sCloses #663
🤖 Generated with Claude Code
Summary by CodeRabbit