File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,8 +172,27 @@ version_lt() {
172172# Migrate from npm to native installer
173173migrate_npm_to_native () {
174174 echo " [claude] Migrating from npm to native installer..." >&2
175- echo " [claude] Removing npm package..." >&2
175+ echo " [claude] Removing npm packages..." >&2
176+
177+ # Remove from current npm
176178 npm uninstall -g @anthropic-ai/claude-code 2> /dev/null || true
179+
180+ # Remove from ALL nvm Node versions (they accumulate)
181+ if [ -d " $HOME /.nvm/versions/node" ]; then
182+ for node_dir in " $HOME /.nvm/versions/node" /* /; do
183+ if [ -d " $node_dir /lib/node_modules/@anthropic-ai" ]; then
184+ echo " [claude] Removing from ${node_dir} ..." >&2
185+ rm -rf " $node_dir /lib/node_modules/@anthropic-ai"
186+ rm -f " $node_dir /bin/claude"
187+ fi
188+ done
189+ fi
190+
191+ # Remove pnpm version if present
192+ if command -v pnpm > /dev/null 2>&1 ; then
193+ pnpm uninstall -g @anthropic-ai/claude-code 2> /dev/null || true
194+ fi
195+
177196 hash -r 2> /dev/null || true
178197 echo " [claude] Installing native version..." >&2
179198 install_native
You can’t perform that action at this time.
0 commit comments