Unhandled Promise Rejection: Duplicate Command Registration in CLI

Resolved 💬 2 comments Opened Jun 7, 2025 by manoj-hans Closed Jun 10, 2025

Bug Description
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: command 'type' already exists
at vX2 (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1376:12108)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async rY5 (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1921:10307)
at async J (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1921:9161)\
\
I am getting this error in windsurf. USing claude code in it. Whenever there are some changes it needs to show the diff of, it shows this error instead.

Environment Info

  • Platform: macos
  • Terminal: windsurf
  • Version: 1.0.17
  • Feedback ID: 7feb93db-0472-4451-87dd-f9c49b8e2d5e

Errors

[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n    at __node_internal_genericNodeError (node:internal/errors:865:15)\n    at checkExecSyncError (node:child_process:890:11)\n    at execSync (node:child_process:962:15)\n    at YZ (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:654:3921)\n    at file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:11794\n    at Q (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:17190)\n    at cJ (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:10940)\n    at aP (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:10021)\n    at a6 (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:14133)\n    at AK1 (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1680:5493)","timestamp":"2025-06-07T09:50:59.541Z"},{"error":"Error: command 'type' already exists\n    at vX2 (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1376:12108)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async rY5 (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1921:10307)\n    at async J (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1921:9161)","timestamp":"2025-06-07T09:58:33.649Z"},{"error":"Error: command 'type' already exists\n    at vX2 (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1376:12108)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async rY5 (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1921:10307)\n    at async J (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1921:9161)","timestamp":"2025-06-07T09:58:48.415Z"},{"error":"Error: command 'type' already exists\n    at vX2 (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1376:12108)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async rY5 (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1921:10307)\n    at async J (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1921:9161)","timestamp":"2025-06-07T10:01:22.681Z"},{"error":"Error: command 'type' already exists\n    at vX2 (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1376:12108)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async rY5 (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1921:10307)\n    at async J (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1921:9161)","timestamp":"2025-06-07T10:01:29.251Z"},{"error":"ShellError: Shell command failed\n    at Object.call (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1573:1326)\n    at async iZ5 (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:19166)\n    at async WK1 (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:17752)\n    at async cZ5 (file:///Users/manojhans/.nvm/versions/node/v18.20.4/lib/node_modules/@anthr

Note: Error logs were truncated.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗