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
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗