Claude command not found解决
我是在使用cc switch管理claude key的时候突然出现的,更新node版本什么的好像也会出现这种情况,这只是最通用的方法,重装(
·
我是在使用cc switch管理claude key的时候突然出现的,更新node版本什么的好像也会出现这种情况,这只是最通用的方法,重装(
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: {redacted}
- 开始删除重装: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
- 然后就成功了
更多推荐
所有评论(0)