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

Resolved 💬 7 comments Opened Oct 16, 2025 by jaipkapoor99 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 ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗