Skip to content

Commit 83ec03b

Browse files
committed
fix(claude): always migrate npm to native installer
The npm package @anthropic-ai/claude-code is deprecated. Previously only migrated when version was outdated; now always migrate any npm installation to the native installer.
1 parent 2247e65 commit 83ec03b

1 file changed

Lines changed: 3 additions & 19 deletions

File tree

scripts/install_claude.sh

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -117,28 +117,12 @@ upgrade_claude() {
117117

118118
# Detect installation method and upgrade accordingly
119119
if echo "$real_path" | grep -q 'node_modules'; then
120-
local current_ver latest_ver
120+
local current_ver
121121
current_ver=$(get_current_version)
122-
latest_ver=$(get_latest_version)
123122

124123
echo "[claude] Detected npm installation (v${current_ver:-unknown})" >&2
125-
126-
# Check if npm version is significantly outdated
127-
# The npm package is deprecated - native installer is now recommended
128-
if [ -n "$latest_ver" ] && [ -n "$current_ver" ] && version_lt "$current_ver" "$latest_ver"; then
129-
echo "[claude] npm package is outdated (latest: $latest_ver)" >&2
130-
echo "[claude] The npm package is deprecated. Native installer recommended." >&2
131-
echo "" >&2
132-
echo "[claude] To migrate manually:" >&2
133-
echo " npm uninstall -g @anthropic-ai/claude-code" >&2
134-
echo " curl -fsSL https://claude.ai/install.sh | bash" >&2
135-
echo "" >&2
136-
echo "[claude] Attempting automatic migration..." >&2
137-
migrate_npm_to_native
138-
else
139-
echo "[claude] Upgrading via npm..." >&2
140-
npm update -g @anthropic-ai/claude-code || install_native
141-
fi
124+
echo "[claude] The npm package is deprecated. Migrating to native installer..." >&2
125+
migrate_npm_to_native
142126
elif echo "$real_path" | grep -q 'Cellar\|homebrew'; then
143127
echo "[claude] Detected Homebrew installation, upgrading via brew..." >&2
144128
brew upgrade --cask claude-code || brew reinstall --cask claude-code

0 commit comments

Comments
 (0)