Skip to content

[BUG] OAuth /login fails with ECONNREFUSED on Windows 11, fresh install, network confirmed OK #60041

Description

@IsmailMAJBAR

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions