[BUG] claude-code for Windows is NOT available due to its port

Resolved 💬 19 comments Opened Jul 12, 2025 by frkavka Closed Jul 17, 2025
💡 Likely answer: A maintainer (ant-kurt, collaborator) responded on this thread — see the highlighted reply below.

<img width="580" height="426" alt="Image" src="https://github.com/user-attachments/assets/94746111-e816-4277-9a56-5aa90d1e73b6" />

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.51
  • Operating System: Windows 11
  • Terminal: Command Prompt / PowerShell

Bug Description

Claude Code fails to start on Windows with OAuth error due to port 54545 conflict with Windows dynamic port range. No configuration option exists to change the port.

Steps to Reproduce

  1. Install Claude Code on Windows: npm install -g @anthropic-ai/claude-code
  2. Run claude-code in administrator Command Prompt
  3. Error occurs: OAuth error: listen EACCES: permission denied 0.0.0.0:54545

Expected Behavior

Claude Code should start successfully and open OAuth authentication in browser.

Actual Behavior

Application fails with permission denied error on port 54545. Port 54545 falls within Windows dynamic port range (49152-65535) which is reserved by the system.

Additional Context

  • Tested with administrator privileges
  • Firewall disabled (ESET + Windows Defender)
  • Confirmed port 54545 is not in use: netstat -ano | findstr :54545 shows nothing
  • Adjusted Windows dynamic port range: netsh int ipv4 set dynamicport tcp start=55000 num=10000
  • No configuration option found in claude.json or CLI help to specify custom port
  • Need port configuration option (CLI flag, environment variable, or config file) to resolve Windows compatibility

View original on GitHub ↗

18 Comments

sebthom · 1 year ago

I had this error too. you can avoid it by patching the node\bin\node_modules\@anthropic-ai\claude-code\cli.js file and replacing the 54545 with a lower port, e.g. 44545

<img width="542" height="201" alt="Image" src="https://github.com/user-attachments/assets/b3534aef-cd01-429f-9740-7096c5a22d52" />

shuiguoqu · 1 year ago
I had this error too. you can avoid it by patching the node\bin\node_modules\@anthropic-ai\claude-code\cli.js file and replacing the 54545 with a lower port, e.g. 44545 <img alt="Image" width="542" height="201" src="https://private-user-images.githubusercontent.com/426959/465657622-b3534aef-cd01-429f-9740-7096c5a22d52.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTIzNjc5NDUsIm5iZiI6MTc1MjM2NzY0NSwicGF0aCI6Ii80MjY5NTkvNDY1NjU3NjIyLWIzNTM0YWVmLWNkMDEtNDI5Zi05NzQwLTcwOTZjNWEyMmQ1Mi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwNzEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDcxM1QwMDQ3MjVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04M2QwNDE3ZjRjNWFhYWZiMWFkYTljMTJkYmI2NmVhZDNmOTVlNTM1YTI4MjFmOGEyOWM5ZTNlYTYwNGIxMWJlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.pt1USNQfTyNLqf7Z5KGlv2JkafeiTSoJORBNLKI1kGU">

It works!!!But is there the potential risks of banning?

vicckuo · 1 year ago
> I had this error too. you can avoid it by patching the node\bin\node_modules\@anthropic-ai\claude-code\cli.js file and replacing the 54545 with a lower port, e.g. 44545 > <img alt="Image" width="542" height="201" src="https://private-user-images.githubusercontent.com/426959/465657622-b3534aef-cd01-429f-9740-7096c5a22d52.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTIzNjc5NDUsIm5iZiI6MTc1MjM2NzY0NSwicGF0aCI6Ii80MjY5NTkvNDY1NjU3NjIyLWIzNTM0YWVmLWNkMDEtNDI5Zi05NzQwLTcwOTZjNWEyMmQ1Mi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwNzEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDcxM1QwMDQ3MjVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04M2QwNDE3ZjRjNWFhYWZiMWFkYTljMTJkYmI2NmVhZDNmOTVlNTM1YTI4MjFmOGEyOWM5ZTNlYTYwNGIxMWJlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.pt1USNQfTyNLqf7Z5KGlv2JkafeiTSoJORBNLKI1kGU"> It works!!!But is there the potential risks of banning?

why i can't find the path after install

shuiguoqu · 1 year ago
> > I had this error too. you can avoid it by patching the node\bin\node_modules\@anthropic-ai\claude-code\cli.js file and replacing the 54545 with a lower port, e.g. 44545 > > <img alt="Image" width="542" height="201" src="https://private-user-images.githubusercontent.com/426959/465657622-b3534aef-cd01-429f-9740-7096c5a22d52.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTIzNjc5NDUsIm5iZiI6MTc1MjM2NzY0NSwicGF0aCI6Ii80MjY5NTkvNDY1NjU3NjIyLWIzNTM0YWVmLWNkMDEtNDI5Zi05NzQwLTcwOTZjNWEyMmQ1Mi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwNzEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDcxM1QwMDQ3MjVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04M2QwNDE3ZjRjNWFhYWZiMWFkYTljMTJkYmI2NmVhZDNmOTVlNTM1YTI4MjFmOGEyOWM5ZTNlYTYwNGIxMWJlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.pt1USNQfTyNLqf7Z5KGlv2JkafeiTSoJORBNLKI1kGU"> > > > It works!!!But is there the potential risks of banning? why i can't find the path after install

You can run "where node" in Windows cmd to check the node path

<img width="507" height="108" alt="Image" src="https://github.com/user-attachments/assets/6929a72d-3f54-4e4d-949d-4f7e9f685f57" />

frkavka · 1 year ago

@sebthom
Thank you for sharing your knowledge! This seems to be originate from the Windows port reservation; the range 49152-65535 can be secured by system. The port 54545 is out of the reserved range on my env TODAY, but your solution will get stable to use Claude Code safely(probably).

falsharif86 · 1 year ago

<img width="2315" height="1270" alt="Image" src="https://github.com/user-attachments/assets/4cfe8a31-ad7b-4e32-b2e4-a28311b9a17b" />

Here's a simpler solution :

Step 1: Change the dynamic port range to exclude 54545

powershell

netsh int ipv4 set dynamicport tcp start=55000 num=10000

Step 2: Verify the change was applied

powershell

netsh int ipv4 show dynamicport tcp
You should see:

Protocol tcp Dynamic Port Range
---------------------------------
Start Port : 55000
Number of Ports : 10000

Step 3: Restart your computer
This is important - the port range changes require a reboot to take effect.

Step 4: After restart, try Claude Code again

The new range (55000-64999) will leave port 54545 free for Claude Code to use, which should resolve the OAuth error.
If for some reason you need to revert this change later, you can restore the original settings with:
powershellnetsh int ipv4 set dynamicport tcp start=49152 num=16384
Go ahead and run that first command, then restart when convenient. This should solve your Claude Code setup issue!

frkavka · 1 year ago
<img alt="Image" width="2000" height="1270" src="https://private-user-images.githubusercontent.com/71377206/465710690-4cfe8a31-ad7b-4e32-b2e4-a28311b9a17b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTI0NTI2NTgsIm5iZiI6MTc1MjQ1MjM1OCwicGF0aCI6Ii83MTM3NzIwNi80NjU3MTA2OTAtNGNmZThhMzEtYWQ3Yi00ZTMyLWIyZTQtYTI4MzExYjlhMTdiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA3MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNzE0VDAwMTkxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFmNTMxZTU4ZjkzYjQ3MGU5YjhiYWY5ZjU4MDcxMTUyOTUwNmIxNjRiM2U4YTc2YzVjNTk2ZTY3OWRjZDg1YjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.3K2vgCA1JakB4UZsfLAUYCeJmD-X21i8uBE2r1qoPxw"> Here's a simpler solution : Step 1: Change the dynamic port range to exclude 54545 powershell netsh int ipv4 set dynamicport tcp start=55000 num=10000 Step 2: Verify the change was applied powershell netsh int ipv4 show dynamicport tcp You should see: ## Protocol tcp Dynamic Port Range Start Port : 55000 Number of Ports : 10000 Step 3: Restart your computer This is important - the port range changes require a reboot to take effect. Step 4: After restart, try Claude Code again The new range (55000-64999) will leave port 54545 free for Claude Code to use, which should resolve the OAuth error. If for some reason you need to revert this change later, you can restore the original settings with: powershellnetsh int ipv4 set dynamicport tcp start=49152 num=16384 Go ahead and run that first command, then restart when convenient. This should solve your Claude Code setup issue!

@falsharif86
Great and smart! This looks more stable until the preset port is changed at least. Thank you for sharing!

trevor-media · 1 year ago

It working

<img width="1226" height="625" alt="Image" src="https://github.com/user-attachments/assets/f678d5e5-2e37-446e-94a7-4abb8b8350f7" />

Kaythecreator · 1 year ago
<img alt="Image" width="2000" height="1270" src="https://private-user-images.githubusercontent.com/71377206/465710690-4cfe8a31-ad7b-4e32-b2e4-a28311b9a17b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTI1MjEwMDcsIm5iZiI6MTc1MjUyMDcwNywicGF0aCI6Ii83MTM3NzIwNi80NjU3MTA2OTAtNGNmZThhMzEtYWQ3Yi00ZTMyLWIyZTQtYTI4MzExYjlhMTdiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA3MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNzE0VDE5MTgyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI2YzA2MWUxMGNhZGU0YmY1NTM3OGEyOWVjMjdmNzNlZWRjYjY1ZjI4MGI0ODhlMmUwZDIwNzZkMzgwMGIzMDYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.65GX__GDOKc6HeRC3ii6nayJcAEHwZSlnO9ax6Ayo8Q"> Here's a simpler solution : Step 1: Change the dynamic port range to exclude 54545 powershell netsh int ipv4 set dynamicport tcp start=55000 num=10000 Step 2: Verify the change was applied powershell netsh int ipv4 show dynamicport tcp You should see: ## Protocol tcp Dynamic Port Range Start Port : 55000 Number of Ports : 10000 Step 3: Restart your computer This is important - the port range changes require a reboot to take effect. Step 4: After restart, try Claude Code again The new range (55000-64999) will leave port 54545 free for Claude Code to use, which should resolve the OAuth error. If for some reason you need to revert this change later, you can restore the original settings with: powershellnetsh int ipv4 set dynamicport tcp start=49152 num=16384 Go ahead and run that first command, then restart when convenient. This should solve your Claude Code setup issue!

this doesn't work for me :/

Stay03 · 1 year ago
<img alt="Image" width="2000" height="1270" src="https://private-user-images.githubusercontent.com/71377206/465710690-4cfe8a31-ad7b-4e32-b2e4-a28311b9a17b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTI1MjYzNzksIm5iZiI6MTc1MjUyNjA3OSwicGF0aCI6Ii83MTM3NzIwNi80NjU3MTA2OTAtNGNmZThhMzEtYWQ3Yi00ZTMyLWIyZTQtYTI4MzExYjlhMTdiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA3MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNzE0VDIwNDc1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQwODMxMjNkZWRiY2E5MzYyNTEzYmYyNGU3ZWRlMWU3MzI4MTRiZjgwZDExOWJhNWUyM2FhYWJiYTAxMDRlZWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.GChc-SHBiWDY6IrNW9n8BTJfk5-p0LNjP721MdyzOsU"> Here's a simpler solution : Step 1: Change the dynamic port range to exclude 54545 powershell netsh int ipv4 set dynamicport tcp start=55000 num=10000 Step 2: Verify the change was applied powershell netsh int ipv4 show dynamicport tcp You should see: ## Protocol tcp Dynamic Port Range Start Port : 55000 Number of Ports : 10000 Step 3: Restart your computer This is important - the port range changes require a reboot to take effect. Step 4: After restart, try Claude Code again The new range (55000-64999) will leave port 54545 free for Claude Code to use, which should resolve the OAuth error. If for some reason you need to revert this change later, you can restore the original settings with: powershellnetsh int ipv4 set dynamicport tcp start=49152 num=16384 Go ahead and run that first command, then restart when convenient. This should solve your Claude Code setup issue!

This worked for me

mattboostkit · 1 year ago

Got the same error, surely the Claude Code team know this is a thing?!?

OAuth error: Port 54545 is already in use. Please ensure no other applications are using this port.

ant-kurt collaborator · 1 year ago

We're working on addressing this - for the meantime, we recommend using the URL to sign in.

ant-kurt collaborator · 1 year ago

In upcoming version v1.0.54, we're changing Claude Code to use port 45454 (outside the dynamic range). As a mitigation, continue to use the URL to sign in.

ant-kurt collaborator · 12 months ago

v1.0.54 released today with this fix. Happy coding!

lukstafi · 12 months ago

Every which way I try installing Claude Code I get the version 1.0.53...

ant-kurt collaborator · 12 months ago

1.0.53 is tagged as latest for the time being, see https://www.npmjs.com/package/@anthropic-ai/claude-code?activeTab=versions

lukstafi · 12 months ago

Funny: it seems curl -fsSL claude.ai/install.sh | bash installed bun under .local\bin\claude.
The syntax to install a specific version is, for example: > npm install -g @anthropic-ai/claude-code@1.0.55

github-actions[bot] · 11 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

Showing cached comments. Read the full discussion on GitHub ↗