Claude command not found 解决方法
我是在使用cc switch管理claude key的时候突然出现的,更新node版本什么的好像也会出现这种情况,这只是最通用的方法,重装(
终端输入 claude 出现
Claude command not found
我就直接重装claude了,记录一下步骤
- 先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:
- 开始删除重装:sudo rm -rf /opt/homebrew/lib/node_modules/@anthropic-ai/claude-code
- npm cache clean --force
- npm install -g @anthropic-ai/claude-code
- claude --version
- 成功
浙公网安备 33010602011771号