参考链接:

https://mp.weixin.qq.com/s/sLrjYC9ALhA_GrvR_jK6JA?click_id=18

https://mp.weixin.qq.com/s/q35wypgU6jH4ztFYJyo7Sg

https://mp.weixin.qq.com/s?__biz=MzkxNjQzNTc4NA==&mid=2247485650&idx=1&sn=45031bc3abe7b8241e1243698a9e7f2f&chksm=c0bf39f7081fc03411e3344056ab56620ffecaaf793e3c3dad8f132acc02638726e8c6a80d90&mpshare=1&scene=24&srcid=1129lMZBaKc6JRUc6WbYJNMZ&sharer_shareinfo=bad766e39d2f04df931be64ec5a141c8&sharer_shareinfo_first=bad766e39d2f04df931be64ec5a141c8#rd

(base) zzq@ubuntu:~/workspace/Hi3516CV610$ npm install -g @anthropic-ai/claude-code
npm error code ENOTEMPTY
npm error syscall rename
npm error path /home/zzq/.nvm/versions/node/v18.20.8/lib/node_modules/@anthropic-ai/claude-code
npm error dest /home/zzq/.nvm/versions/node/v18.20.8/lib/node_modules/@anthropic-ai/.claude-code-PTfX7Oph
npm error errno -39
npm error ENOTEMPTY: directory not empty, rename '/home/zzq/.nvm/versions/node/v18.20.8/lib/node_modules/@anthropic-ai/claude-code' -> '/home/zzq/.nvm/versions/node/v18.20.8/lib/node_modules/@anthropic-ai/.claude-code-PTfX7Oph'
npm error A complete log of this run can be found in: /home/zzq/.npm/_logs/2025-11-26T00_41_43_063Z-debug-0.log

(base) zzq@ubuntu:~/workspace/Hi3516CV610$ ls /home/zzq/.nvm/versions/node/v18.20.8/lib/node_modules/@anthropic-ai/claude-code/
cli.js          LICENSE.md      node_modules/   package.json    README.md       sdk-tools.d.ts  vendor/         
(base) zzq@ubuntu:~/workspace/Hi3516CV610$ ls /home/zzq/.nvm/versions/node/v18.20.8/lib/node_modules/@anthropic-ai/claude-code/
cli.js          LICENSE.md      node_modules/   package.json    README.md       sdk-tools.d.ts  vendor/ 
(base) zzq@ubuntu:~/workspace/Hi3516CV610$ rm -rf /home/zzq/.nvm/versions/node/v18.20.8/lib/node_modules/@anthropic-ai  #暴力删除残留目录
(base) zzq@ubuntu:~/workspace/Hi3516CV610$ npm cache clean --force  #清理 NPM 缓存
(base) zzq@ubuntu:~/workspace/Hi3516CV610$ npm install -g @anthropic-ai/claude-code  #再次尝试安装
 

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐