[BUG] Claude Code 2.1.0 crashes on startup - Invalid Version semver parsing error

2 min read Original article ↗

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Claude Code 2.1.0 fails to launch with a semver parsing error. The application crashes immediately on startup with:
ERROR Invalid Version: 2.1.0 (2026-01-07)

Application crashes on startup before any UI is displayed. The semver validation fails because the version string contains a non-semver-compliant date suffix.

What Should Happen?

Claude Code should start normally.

Error Messages/Logs

## Root Cause

The version string `2.1.0 (2026-01-07)` includes a date in parentheses, which is not valid semver format. The semver library only accepts:
- Standard format: `2.1.0`
- Prerelease format: `2.1.0-beta.1`

The date suffix `(2026-01-07)` causes the semver parser to reject the version string entirely.


## Full Stack Trace


ERROR Invalid Version: 2.1.0 (2026-01-07)
TypeError: Invalid Version: 2.1.0 (2026-01-07)
    at new Pw (file:///Users/[user]/.npm/_npx/[hash]/node_modules/@anthropic-ai/claude-code/cli.mjs:813:1565)
    at kw (file:///Users/[user]/.npm/_npx/[hash]/node_modules/@anthropic-ai/claude-code/cli.mjs:813:1867)
    at Dw (file:///Users/[user]/.npm/_npx/[hash]/node_modules/@anthropic-ai/claude-code/cli.mjs:813:ь2convey)
    ... [additional stack frames in bundled code]

Steps to Reproduce

  1. Update to Claude Code 2.1.0 (via auto-update or npm install -g @anthropic-ai/claude-code@latest)
  2. Run claude in terminal
  3. Application crashes immediately with semver error

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.0.76

Claude Code Version

2.1.0 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

Additional Context

This appears to be a release configuration issue where the version string was set to include a release date. The fix would be to either:

  1. Remove the date suffix from the version string
  2. Use semver-compliant prerelease format if date tracking is needed (e.g., 2.1.0+20260107)

Labels (suggested)

  • bug
  • area:packaging
  • priority:critical