ERR_PACKAGE_PATH_NOT_EXPORTED node esm ai_generated true

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './internal' is not defined by exports

ID: node/err-package-path-not-exported

Also available as: JSON · Markdown
92%Fix Rate
94%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
20 active

Root Cause

Importing a subpath that the package's exports map doesn't expose.

generic

Workarounds

  1. 93% success Use the package's public API — check its package.json exports field for available paths
    Import from the documented public paths, not internal modules
  2. 85% success If the subpath was previously available, check the changelog for migration instructions
    The maintainer likely moved it or removed it intentionally in a major version

Dead Ends

Common approaches that don't work:

  1. Patching node_modules to add the export 90% fail

    Will be overwritten on next npm install

  2. Using require.resolve with custom paths 70% fail

    Bypasses package boundaries; may break with updates

Error Chain

Frequently confused with: