Claude Code CLI: Node.js v25 Incompatibility - TypeError "prototype" is undefined in cli.js

Status Fixed / completed
Maintainer reply None cached
Activity 7 comments · opened Oct 16, 2025 · closed Oct 17, 2025

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

  1. Install Node.js v25.0.0 on WSL/Ubuntu
  2. Run: npm install -g @anthropic-ai/claude-code
  3. Attempt to run: claude
  4. 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

View original on GitHub ↗

7 Comments

github-actions[bot] · 10 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/9628
  2. https://github.com/anthropics/claude-code/issues/9639

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

kud · 10 months ago

I thought it was my Claude config that caused that, so I removed everything, but actually, it's Node v25. 🥹

gosuto-inzasheru · 10 months ago

same issue; claude cli command is bricked

gosuto-inzasheru · 10 months ago

downgrading to node<25.0.0 fixed the issue for me

gosuto-inzasheru · 10 months ago

indeed this is a dupe of #9628

jaipkapoor99 · 10 months ago

Closing as duplicate of #9628.

github-actions[bot] · 10 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.