claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Can't run, uninstall or run claude

Open swdevbali opened this issue 1 year ago • 3 comments

Environment

  • Platform (select one): Mac sequoia 15.01

Bug Description

Running install: npm install -g @anthropic-ai/claude-code npm error code ENOTEMPTY npm error syscall rename npm error path /opt/homebrew/lib/node_modules/@anthropic-ai/claude-code npm error dest /opt/homebrew/lib/node_modules/@anthropic-ai/.claude-code-2DTsDk1V npm error errno -66 npm error ENOTEMPTY: directory not empty, rename '/opt/homebrew/lib/node_modules/@anthropic-ai/claude-code' -> '/opt/homebrew/lib/node_modules/@anthropic-ai/.claude-code-2DTsDk1V' npm error A complete log of this run can be found in: /Users/ekowibowo/.npm/_logs/2025-08-08T02_34_15_657Z-debug-0.log

Steps to Reproduce

No idea, it works just fine previously. doing nothing and then like this. the one in my pc works as usual

Expected Behavior

Can run claude

Actual Behavior

claude zsh: command not found: claude

Additional Context

Complete: cat /Users/ekowibowo/.npm/_logs/2025-08-08T02_34_15_657Z-debug-0.log 0 verbose cli /opt/homebrew/Cellar/node/23.9.0/bin/node /opt/homebrew/bin/npm 1 info using [email protected] 2 info using [email protected] 3 silly config load:file:/opt/homebrew/lib/node_modules/npm/npmrc 4 silly config load:file:/Users/ekowibowo/.npmrc 5 silly config load:file:/opt/homebrew/etc/npmrc 6 verbose title npm install @anthropic-ai/claude-code 7 verbose argv "install" "--global" "@anthropic-ai/claude-code" 8 verbose logfile logs-max:10 dir:/Users/ekowibowo/.npm/_logs/2025-08-08T02_34_15_657Z- 9 verbose logfile /Users/ekowibowo/.npm/_logs/2025-08-08T02_34_15_657Z-debug-0.log 10 silly packumentCache heap:2197815296 maxSize:549453824 maxEntrySize:274726912 11 silly logfile start cleaning logs, removing 1 files 12 silly logfile done cleaning log files 13 silly idealTree buildDeps 14 silly fetch manifest @anthropic-ai/claude-code@* 15 silly packumentCache full:https://registry.npmjs.org/@anthropic-ai%2fclaude-code cache-miss 16 http fetch GET https://registry.npmjs.org/@anthropic-ai%2fclaude-code attempt 1 failed with ENOTFOUND 17 http fetch GET 200 https://registry.npmjs.org/@anthropic-ai%2fclaude-code 11574ms (cache revalidated) 18 silly packumentCache full:https://registry.npmjs.org/@anthropic-ai%2fclaude-code set size:412060 disposed:false 19 silly placeDep ROOT @anthropic-ai/[email protected] OK for: want: * 20 silly fetch manifest @img/sharp-linux-arm@^0.33.5 21 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-linux-arm cache-miss 22 silly fetch manifest @img/sharp-linux-x64@^0.33.5 23 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-linux-x64 cache-miss 24 silly fetch manifest @img/sharp-win32-x64@^0.33.5 25 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-win32-x64 cache-miss 26 silly fetch manifest @img/sharp-darwin-x64@^0.33.5 27 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-darwin-x64 cache-miss 28 silly fetch manifest @img/sharp-linux-arm64@^0.33.5 29 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-linux-arm64 cache-miss 30 silly fetch manifest @img/sharp-darwin-arm64@^0.33.5 31 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-darwin-arm64 cache-miss 32 http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-linux-x64 93ms (cache revalidated) 33 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-linux-x64 set size:52371 disposed:false 34 http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-darwin-x64 284ms (cache revalidated) 35 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-darwin-x64 set size:51571 disposed:false 36 http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-linux-arm 290ms (cache revalidated) 37 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-linux-arm set size:52646 disposed:false 38 http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-darwin-arm64 289ms (cache revalidated) 39 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-darwin-arm64 set size:52294 disposed:false 40 http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-linux-arm64 295ms (cache revalidated) 41 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-linux-arm64 set size:53085 disposed:false 42 http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-win32-x64 321ms (cache revalidated) 43 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-win32-x64 set size:55114 disposed:false 44 silly placeDep node_modules/@anthropic-ai/claude-code @img/[email protected] OK for: @anthropic-ai/[email protected] want: ^0.33.5 45 silly placeDep node_modules/@anthropic-ai/claude-code @img/[email protected] OK for: @anthropic-ai/[email protected] want: ^0.33.5 46 silly placeDep node_modules/@anthropic-ai/claude-code @img/[email protected] OK for: @anthropic-ai/[email protected] want: ^0.33.5 47 silly placeDep node_modules/@anthropic-ai/claude-code @img/[email protected] OK for: @anthropic-ai/[email protected] want: ^0.33.5 48 silly placeDep node_modules/@anthropic-ai/claude-code @img/[email protected] OK for: @anthropic-ai/[email protected] want: ^0.33.5 49 silly placeDep node_modules/@anthropic-ai/claude-code @img/[email protected] OK for: @anthropic-ai/[email protected] want: ^0.33.5 50 silly fetch manifest @img/[email protected] 51 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-libvips-darwin-arm64 cache-miss 52 silly fetch manifest @img/[email protected] 53 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-libvips-darwin-x64 cache-miss 54 silly fetch manifest @img/[email protected] 55 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-libvips-linux-arm cache-miss 56 silly fetch manifest @img/[email protected] 57 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-libvips-linux-arm64 cache-miss 58 silly fetch manifest @img/[email protected] 59 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-libvips-linux-x64 cache-miss 60 http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-darwin-arm64 336ms (cache revalidated) 61 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-libvips-darwin-arm64 set size:40411 disposed:false 62 http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-linux-arm64 342ms (cache revalidated) 63 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-libvips-linux-arm64 set size:43033 disposed:false 64 http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-linux-x64 342ms (cache revalidated) 65 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-libvips-linux-x64 set size:44397 disposed:false 66 http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-darwin-x64 351ms (cache revalidated) 67 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-libvips-darwin-x64 set size:39990 disposed:false 68 http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-linux-arm 352ms (cache revalidated) 69 silly packumentCache full:https://registry.npmjs.org/@img%2fsharp-libvips-linux-arm set size:46296 disposed:false 70 silly placeDep node_modules/@anthropic-ai/claude-code @img/[email protected] OK for: @img/[email protected] want: 1.0.4 71 silly placeDep node_modules/@anthropic-ai/claude-code @img/[email protected] OK for: @img/[email protected] want: 1.0.4 72 silly placeDep node_modules/@anthropic-ai/claude-code @img/[email protected] OK for: @img/[email protected] want: 1.0.5 73 silly placeDep node_modules/@anthropic-ai/claude-code @img/[email protected] OK for: @img/[email protected] want: 1.0.4 74 silly placeDep node_modules/@anthropic-ai/claude-code @img/[email protected] OK for: @img/[email protected] want: 1.0.4 75 silly reify mark retired [ '/opt/homebrew/lib/node_modules/@anthropic-ai/claude-code' ] 76 silly reify moves { 76 silly reify '/opt/homebrew/lib/node_modules/@anthropic-ai/claude-code': '/opt/homebrew/lib/node_modules/@anthropic-ai/.claude-code-2DTsDk1V' 76 silly reify } 77 verbose stack Error: ENOTEMPTY: directory not empty, rename '/opt/homebrew/lib/node_modules/@anthropic-ai/claude-code' -> '/opt/homebrew/lib/node_modules/@anthropic-ai/.claude-code-2DTsDk1V' 77 verbose stack at async Object.rename (node:internal/fs/promises:779:10) 77 verbose stack at async moveFile (/opt/homebrew/lib/node_modules/npm/node_modules/@npmcli/fs/lib/move-file.js:30:5) 77 verbose stack at async Promise.allSettled (index 0) 77 verbose stack at async [reifyPackages] (/opt/homebrew/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:325:11) 77 verbose stack at async Arborist.reify (/opt/homebrew/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:142:5) 77 verbose stack at async Install.exec (/opt/homebrew/lib/node_modules/npm/lib/commands/install.js:150:5) 77 verbose stack at async Npm.exec (/opt/homebrew/lib/node_modules/npm/lib/npm.js:207:9) 77 verbose stack at async module.exports (/opt/homebrew/lib/node_modules/npm/lib/cli/entry.js:74:5) 78 error code ENOTEMPTY 79 error syscall rename 80 error path /opt/homebrew/lib/node_modules/@anthropic-ai/claude-code 81 error dest /opt/homebrew/lib/node_modules/@anthropic-ai/.claude-code-2DTsDk1V 82 error errno -66 83 error ENOTEMPTY: directory not empty, rename '/opt/homebrew/lib/node_modules/@anthropic-ai/claude-code' -> '/opt/homebrew/lib/node_modules/@anthropic-ai/.claude-code-2DTsDk1V' 84 silly unfinished npm timer reify 1754620456129 85 silly unfinished npm timer reify:retireShallow 1754620468430 86 verbose cwd /Users/ekowibowo 87 verbose os Darwin 24.0.0 88 verbose node v23.9.0 89 verbose npm v10.9.2 90 verbose exit -66 91 verbose code -66

swdevbali avatar Aug 08 '25 02:08 swdevbali

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/1682
  2. https://github.com/anthropics/claude-code/issues/5121
  3. https://github.com/anthropics/claude-code/issues/3172

If your issue is a duplicate, please close it and 👍 the existing issue instead.

This issue will be automatically closed as a duplicate in 3 days if there are no additional comments. To prevent auto-closure, please 👎 this comment.

🤖 Generated with Claude Code

github-actions[bot] avatar Aug 08 '25 02:08 github-actions[bot]

Sorry, simple solution: rm -rf "claude code inside node_modules"

swdevbali avatar Aug 08 '25 02:08 swdevbali

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Aug 16 '25 14:08 github-actions[bot]