claude-code - 💡(How to fix) Fix [Bug] Authentication Error: 401 Unauthorized on API Requests [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#55175Fetched 2026-05-01 05:44:18
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1cross-referenced ×1

Error Message

[{"error":"AxiosError: Request failed with status code 401\n at hn (B:/~BUN/root/src/entrypoints/cli.js:115:1194)\n at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:120:12716)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:865:50)\n at processTicksAndRejections (native:7:39)\n at request (B:/~BUN/root/src/entrypoints/cli.js:122:2467)\n at async Kk (B:/~BUN/root/src/entrypoints/cli.js:444:4918)\n at async <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:2713:190)\n at async <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:6874:23779)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T16:28:51.285Z"},{"error":"AxiosError: Request failed with status code 401\n at hn (B:/~BUN/root/src/entrypoints/cli.js:115:1194)\n at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:120:12716)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:865:50)\n at processTicksAndRejections (native:7:39)\n at request (B:/~BUN/root/src/entrypoints/cli.js:122:2467)\n at async x6A (B:/~BUN/root/src/entrypoints/cli.js:6531:4763)\n at async <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:6531:5994)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T16:28:51.822Z"},{"error":"AxiosError: Request failed with status code 401\n at hn (B:/~BUN/root/src/entrypoints/cli.js:115:1194)\n at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:120:12716)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:865:50)\n at processTicksAndRejections (native:7:39)\n at request (B:/~BUN/root/src/entrypoints/cli.js:122:2467)\n at async aJ9 (B:/~BUN/root/src/entrypoints/cli.js:3168:14725)\n at async b27 (B:/~BUN/root/src/entrypoints/cli.js:3168:15264)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T16:28:51.822Z"},{"error":"AxiosError: Request failed with status code 401\n at hn (B:/~BUN/root/src/entrypoints/cli.js:115:1194)\n at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:120:12716)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:865:50)\n at processTicksAndRejections (native:7:39)\n at request (B:/~BUN/root/src/entrypoints/cli.js:122:2467)\n at async <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:9254:20340)\n at async Kk (B:/~BUN/root/src/entrypoints/cli.js:444:4918)\n at async EEA (B:/~BUN/root/src/entrypoints/cli.js:9254:20097)\n at async ZE_ (B:/~BUN/root/src/entrypoints/cli.js:9254:20732)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T16:28:52.119Z"},{"error":"Error\n at generate (B:/~BUN/root/src/entrypoints/cli.js:11:57485)\n at makeRequest (B:/~BUN/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (unknown:7:39)","timestamp":"2026-05-01T02:09:49.274Z"},{"error":"SUH: Failed to install new version of claude: npm error code EBUSY\nnpm error syscall copyfile\nnpm error path C:\Users\sargb\AppData\Roaming\npm\node_modules\@anthropic-ai\claude-code\node_modules\@anthropic-ai\claude-code-win32-x64\claude.exe\nnpm error dest C:\Users\sargb\AppData\Roaming\npm\node_modules\@anthropic-ai\.claude-code-FPgVQFmD\node_modules\@anthropic-ai\claude-code-win32-x64\claude.exe\nnpm error errno -4082\nnpm error EBUSY: resource busy or locked, copyfile 'C:\Users\sargb\AppData\Roaming\npm\node_modules\@anthropic-ai\claude-code\node_modules\@anthropic-ai\claude-code-win32-x64\claude.exe' -> 'C:\Users\sargb\AppData\Roaming\npm\node_modules\@anthropic-ai\.claude-code-FPgVQFmD\node_modules\@anthropic-ai\claude-code-win32-x64\claude.exe'\nnpm error A complete log of this run can be found in: C:\Users\sargb\AppData\Local\npm-cache\_logs\2026-05-01T02_10_51_605Z-debug-0.log\n at zY8 (B:/~BUN/root/src/entrypoints/cli.js:2823:2203)\n at async <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:9053:10782)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-01T02:10:52.538Z"},{"error":"Error\n at generate (B:/~BUN/root/src/entrypoints/cli.js:11:57485)\n at makeRequest (B:/~BUN/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (unknown:7:39)","timestamp":"2026-05-01T02:11:43.851Z"},{"error":"SUH: Failed to install new version of claude: npm error code EBUSY\nnpm error syscall copyfile\nnpm error path C:\Users\sargb\AppData\Roaming\npm\node_modules\@anthropic-ai\claude-code\node_modules\@anthropic-ai\claude-code-win32-x64\claude.exe\nnpm error dest C…

Code Example

[{"error":"AxiosError: Request failed with status code 401\n    at hn (B:/~BUN/root/src/entrypoints/cli.js:115:1194)\n    at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:120:12716)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (B:/~BUN/root/src/entrypoints/cli.js:122:2467)\n    at async Kk (B:/~BUN/root/src/entrypoints/cli.js:444:4918)\n    at async <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:2713:190)\n    at async <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:6874:23779)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T16:28:51.285Z"},{"error":"AxiosError: Request failed with status code 401\n    at hn (B:/~BUN/root/src/entrypoints/cli.js:115:1194)\n    at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:120:12716)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (B:/~BUN/root/src/entrypoints/cli.js:122:2467)\n    at async x6A (B:/~BUN/root/src/entrypoints/cli.js:6531:4763)\n    at async <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:6531:5994)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T16:28:51.822Z"},{"error":"AxiosError: Request failed with status code 401\n    at hn (B:/~BUN/root/src/entrypoints/cli.js:115:1194)\n    at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:120:12716)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (B:/~BUN/root/src/entrypoints/cli.js:122:2467)\n    at async aJ9 (B:/~BUN/root/src/entrypoints/cli.js:3168:14725)\n    at async b27 (B:/~BUN/root/src/entrypoints/cli.js:3168:15264)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T16:28:51.822Z"},{"error":"AxiosError: Request failed with status code 401\n    at hn (B:/~BUN/root/src/entrypoints/cli.js:115:1194)\n    at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:120:12716)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (B:/~BUN/root/src/entrypoints/cli.js:122:2467)\n    at async <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:9254:20340)\n    at async Kk (B:/~BUN/root/src/entrypoints/cli.js:444:4918)\n    at async EEA (B:/~BUN/root/src/entrypoints/cli.js:9254:20097)\n    at async ZE_ (B:/~BUN/root/src/entrypoints/cli.js:9254:20732)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T16:28:52.119Z"},{"error":"Error\n    at generate (B:/~BUN/root/src/entrypoints/cli.js:11:57485)\n    at makeRequest (B:/~BUN/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (unknown:7:39)","timestamp":"2026-05-01T02:09:49.274Z"},{"error":"SUH: Failed to install new version of claude:  npm error code EBUSY\nnpm error syscall copyfile\nnpm error path C:\\Users\\sargb\\AppData\\Roaming\\npm\\node_modules\\@anthropic-ai\\claude-code\\node_modules\\@anthropic-ai\\claude-code-win32-x64\\claude.exe\nnpm error dest C:\\Users\\sargb\\AppData\\Roaming\\npm\\node_modules\\@anthropic-ai\\.claude-code-FPgVQFmD\\node_modules\\@anthropic-ai\\claude-code-win32-x64\\claude.exe\nnpm error errno -4082\nnpm error EBUSY: resource busy or locked, copyfile 'C:\\Users\\sargb\\AppData\\Roaming\\npm\\node_modules\\@anthropic-ai\\claude-code\\node_modules\\@anthropic-ai\\claude-code-win32-x64\\claude.exe' -> 'C:\\Users\\sargb\\AppData\\Roaming\\npm\\node_modules\\@anthropic-ai\\.claude-code-FPgVQFmD\\node_modules\\@anthropic-ai\\claude-code-win32-x64\\claude.exe'\nnpm error A complete log of this run can be found in: C:\\Users\\sargb\\AppData\\Local\\npm-cache\\_logs\\2026-05-01T02_10_51_605Z-debug-0.log\n    at zY8 (B:/~BUN/root/src/entrypoints/cli.js:2823:2203)\n    at async <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:9053:10782)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-01T02:10:52.538Z"},{"error":"Error\n    at generate (B:/~BUN/root/src/entrypoints/cli.js:11:57485)\n    at makeRequest (B:/~BUN/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (unknown:7:39)","timestamp":"2026-05-01T02:11:43.851Z"},{"error":"SUH: Failed to install new version of claude:  npm error code EBUSY\nnpm error syscall copyfile\nnpm error path C:\\Users\\sargb\\AppData\\Roaming\\npm\\node_modules\\@anthropic-ai\\claude-code\\node_modules\\@anthropic-ai\\claude-code-win32-x64\\claude.exe\nnpm error dest C
RAW_BUFFERClick to expand / collapse

Bug Description keep getting auth screen and api error: 401

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.1.123
  • Feedback ID: 36c2939f-c443-4c58-b953-14819d9410c0

Errors

[{"error":"AxiosError: Request failed with status code 401\n    at hn (B:/~BUN/root/src/entrypoints/cli.js:115:1194)\n    at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:120:12716)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (B:/~BUN/root/src/entrypoints/cli.js:122:2467)\n    at async Kk (B:/~BUN/root/src/entrypoints/cli.js:444:4918)\n    at async <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:2713:190)\n    at async <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:6874:23779)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T16:28:51.285Z"},{"error":"AxiosError: Request failed with status code 401\n    at hn (B:/~BUN/root/src/entrypoints/cli.js:115:1194)\n    at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:120:12716)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (B:/~BUN/root/src/entrypoints/cli.js:122:2467)\n    at async x6A (B:/~BUN/root/src/entrypoints/cli.js:6531:4763)\n    at async <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:6531:5994)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T16:28:51.822Z"},{"error":"AxiosError: Request failed with status code 401\n    at hn (B:/~BUN/root/src/entrypoints/cli.js:115:1194)\n    at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:120:12716)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (B:/~BUN/root/src/entrypoints/cli.js:122:2467)\n    at async aJ9 (B:/~BUN/root/src/entrypoints/cli.js:3168:14725)\n    at async b27 (B:/~BUN/root/src/entrypoints/cli.js:3168:15264)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T16:28:51.822Z"},{"error":"AxiosError: Request failed with status code 401\n    at hn (B:/~BUN/root/src/entrypoints/cli.js:115:1194)\n    at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:120:12716)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (B:/~BUN/root/src/entrypoints/cli.js:122:2467)\n    at async <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:9254:20340)\n    at async Kk (B:/~BUN/root/src/entrypoints/cli.js:444:4918)\n    at async EEA (B:/~BUN/root/src/entrypoints/cli.js:9254:20097)\n    at async ZE_ (B:/~BUN/root/src/entrypoints/cli.js:9254:20732)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-30T16:28:52.119Z"},{"error":"Error\n    at generate (B:/~BUN/root/src/entrypoints/cli.js:11:57485)\n    at makeRequest (B:/~BUN/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (unknown:7:39)","timestamp":"2026-05-01T02:09:49.274Z"},{"error":"SUH: Failed to install new version of claude:  npm error code EBUSY\nnpm error syscall copyfile\nnpm error path C:\\Users\\sargb\\AppData\\Roaming\\npm\\node_modules\\@anthropic-ai\\claude-code\\node_modules\\@anthropic-ai\\claude-code-win32-x64\\claude.exe\nnpm error dest C:\\Users\\sargb\\AppData\\Roaming\\npm\\node_modules\\@anthropic-ai\\.claude-code-FPgVQFmD\\node_modules\\@anthropic-ai\\claude-code-win32-x64\\claude.exe\nnpm error errno -4082\nnpm error EBUSY: resource busy or locked, copyfile 'C:\\Users\\sargb\\AppData\\Roaming\\npm\\node_modules\\@anthropic-ai\\claude-code\\node_modules\\@anthropic-ai\\claude-code-win32-x64\\claude.exe' -> 'C:\\Users\\sargb\\AppData\\Roaming\\npm\\node_modules\\@anthropic-ai\\.claude-code-FPgVQFmD\\node_modules\\@anthropic-ai\\claude-code-win32-x64\\claude.exe'\nnpm error A complete log of this run can be found in: C:\\Users\\sargb\\AppData\\Local\\npm-cache\\_logs\\2026-05-01T02_10_51_605Z-debug-0.log\n    at zY8 (B:/~BUN/root/src/entrypoints/cli.js:2823:2203)\n    at async <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:9053:10782)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-01T02:10:52.538Z"},{"error":"Error\n    at generate (B:/~BUN/root/src/entrypoints/cli.js:11:57485)\n    at makeRequest (B:/~BUN/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (unknown:7:39)","timestamp":"2026-05-01T02:11:43.851Z"},{"error":"SUH: Failed to install new version of claude:  npm error code EBUSY\nnpm error syscall copyfile\nnpm error path C:\\Users\\sargb\\AppData\\Roaming\\npm\\node_modules\\@anthropic-ai\\claude-code\\node_modules\\@anthropic-ai\\claude-code-win32-x64\\claude.exe\nnpm error dest C…

Note: Content was truncated.

extent analysis

TL;DR

The most likely fix is to address the authentication issue causing the 401 error, possibly by re-authenticating or checking token validity.

Guidance

  • Check Authentication Tokens: Verify that authentication tokens are valid and not expired, as 401 errors often indicate authentication issues.
  • Re-authenticate: Attempt to re-authenticate to obtain a new token or session, which might resolve the issue if the current token is invalid or expired.
  • Review API Request: Examine the API request being made to ensure it includes the necessary authentication headers or parameters.
  • Inspect Error Logs: Look into the detailed error logs provided for any clues about the authentication failure, such as specific error messages related to token validation or authentication mechanisms.

Example

No specific code example can be provided without more context on the authentication mechanism used, but ensuring that authentication tokens are properly included in requests (e.g., via headers like Authorization: Bearer <token>) is crucial.

Notes

The provided error logs suggest repeated authentication failures, indicating a potential issue with how authentication is being handled in the application. Without more specific details on the authentication flow or the exact requests being made, it's challenging to provide a more targeted solution.

Recommendation

Apply a workaround by re-authenticating and verifying token validity, as this directly addresses the 401 error messages indicating authentication failures.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] Authentication Error: 401 Unauthorized on API Requests [1 comments, 2 participants]