Claude Code CLI: Node.js v25 Incompatibility - TypeError "prototype" is undefined in cli.js
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
After installing @anthropic-ai/claude-code CLI via npm (npm install -g @anthropic-ai/claude-code), the CLI fails instantly with:
TypeError: Cannot read properties of undefined (reading 'prototype')
at file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:634:25327
... (full stack in user message)
The issue occurs on Node.js v25.0.0 in WSL/Ubuntu environment. The CLI cannot execute at all.
What Should Happen?
The CLI should execute normally without throwing TypeErrors. It should be compatible with Node.js v25.0.0 and properly handle Buffer, crypto, and other core modules that may have changed in newer Node.js versions.
Error Messages/Logs
Steps to Reproduce
- Install Node.js v25.0.0 on WSL/Ubuntu
- Run: npm install -g @anthropic-ai/claude-code
- Attempt to run: claude
- Observe instant TypeError about 'prototype' being undefined
Additional attempts made:
- Full uninstall/reinstall with npm
- Non-root installation
- Direct CLI invocation
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
Latest from npm (v25 incompatible)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
Request:
- Please add Node.js v25 support
- Update dependencies (Buffer, crypto etc) for Node 25 compatibility
- Document working Node.js versions clearly
7 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I thought it was my Claude config that caused that, so I removed everything, but actually, it's Node v25. 🥹
same issue;
claudecli command is brickeddowngrading to node<25.0.0 fixed the issue for me
indeed this is a dupe of #9628
Closing as duplicate of #9628.
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.