[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
- Install Claude Code on Windows:
npm install -g @anthropic-ai/claude-code - Run
claude-codein administrator Command Prompt - 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 :54545shows 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
Showing cached comments. Read the full discussion on GitHub ↗
18 Comments
I had this error too. you can avoid it by patching the
node\bin\node_modules\@anthropic-ai\claude-code\cli.jsfile and replacing the54545with 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" />
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" />
@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).
<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!
@falsharif86
Great and smart! This looks more stable until the preset port is changed at least. Thank you for sharing!
It working
<img width="1226" height="625" alt="Image" src="https://github.com/user-attachments/assets/f678d5e5-2e37-446e-94a7-4abb8b8350f7" />
this doesn't work for me :/
This worked for me
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.
We're working on addressing this - for the meantime, we recommend using the URL to sign in.
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.
v1.0.54 released today with this fix. Happy coding!
Every which way I try installing Claude Code I get the version 1.0.53...
1.0.53 is tagged as
latestfor the time being, see https://www.npmjs.com/package/@anthropic-ai/claude-code?activeTab=versionsFunny: it seems
curl -fsSL claude.ai/install.sh | bashinstalledbununder.local\bin\claude.The syntax to install a specific version is, for example:
> npm install -g @anthropic-ai/claude-code@1.0.55This 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.