claude-code - 💡(How to fix) Fix [BUG] OAuth /login fails with ECONNREFUSED on Windows 11, fresh install, network confirmed OK

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…

Error Message

  1. Callback to localhost fails with OAuth error: ECONNREFUSED
  • Both OAuth flow and desktop app "Claude Code" tab produce same error

Error Messages/Logs

  1. Callback to localhost fails with OAuth error: ECONNREFUSED

Fix Action

Fix / Workaround

Workaround in use: desktop app chat tab works fine, only /login flow and Claude Code tab affected.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Title: OAuth /login fails with ECONNREFUSED on Windows 11, fresh install, network confirmed OK

Environment:

  • OS: Windows 11
  • Claude Code: 2.1.143 (npm-global install)
  • Node.js: v24.13.1
  • Claude Desktop app: same ECONNREFUSED on Claude Code tab

Steps to reproduce:

  1. Fresh install via npm install -g @anthropic-ai/claude-code
  2. Run claude → "Welcome back!" banner displays correctly
  3. Run /login → browser opens, OAuth completes on Anthropic side
  4. Callback to localhost fails with OAuth error: ECONNREFUSED

Network diagnostics (all passing):

  • curl https://api.anthropic.com/ → 404 with proper Anthropic ASCII logo response
  • Test-NetConnection api.anthropic.com -Port 443 → TcpTestSucceeded: True
  • ping 127.0.0.1 → 0% loss
  • DNS: Cloudflare + Google (IPv4 + IPv6)
  • No HTTPS_PROXY / HTTP_PROXY / ANTHROPIC_* env vars
  • No custom URLs in .claude.json
  • netsh excluded port ranges: only 50000-50059 (normal)

Also tested:

  • Multiple browsers (Opera, Chrome) → same ECONNREFUSED on callback
  • Removed .claude.json and .claude/ → re-init OK but /login still fails
  • Both OAuth flow and desktop app "Claude Code" tab produce same error

Workaround in use: desktop app chat tab works fine, only /login flow and Claude Code tab affected.

What Should Happen?

to be able to use claude code

Error Messages/Logs

Steps to Reproduce

Steps to reproduce:

  1. Fresh install via npm install -g @anthropic-ai/claude-code
  2. Run claude → "Welcome back!" banner displays correctly
  3. Run /login → browser opens, OAuth completes on Anthropic side
  4. Callback to localhost fails with OAuth error: ECONNREFUSED

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.143

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

No response

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] OAuth /login fails with ECONNREFUSED on Windows 11, fresh install, network confirmed OK