[BUG] @anthropic-ai/claude-code npm package missing sdk.mjs entry point

Resolved 💬 2 comments Opened Oct 23, 2025 by nseldeib Closed Oct 23, 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?

The published npm package @anthropic-ai/claude-code@2.0.25 (and earlier versions) is missing its main entry point file, causing module resolution failures.

Impact: Any project depending on this package cannot import its functionality and fails with ERR_MODULE_NOT_FOUND.

Affected versions: At least 2.0.5 through 2.0.25 (latest)

Preflight Checklist Verification:

✅ I am using the latest version of Claude Code

  • Confirmed: Version 2.0.25 (latest as of npm registry check)

✅ I have searched existing issues and this hasn't been reported yet

  • Searched GitHub issues for: "sdk.mjs", "missing entry point", "ERR_MODULE_NOT_FOUND", "@anthropic-ai/claude-code" and no existing issues found matching this npm package problem

✅ This is a single bug report

  • Yes, this is specifically about the missing sdk.mjs file in the published npm package

What Should Happen?

Expected behavior:
The sdk.mjs file should be included in the published package as declared in package.json ("main": "sdk.mjs").

Error Messages/Logs

Steps to Reproduce

To Reproduce:

  1. Install the package: npm install @anthropic-ai/claude-code@2.0.25
  2. Try to import from it: import { query } from '@anthropic-ai/claude-code'
  3. Error: Cannot find package '.../node_modules/@anthropic-ai/claude-code/sdk.mjs'

Actual behavior:

  • package.json declares: "main": "sdk.mjs"
  • Published package contents show no sdk.mjs file (verified with npm pack --dry-run)
  • Only files present: cli.js, sdk-tools.d.ts, LICENSE.md, README.md, and vendor JetBrains plugin JARs

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.0.25

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

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