ERR_PACKAGE_PATH_NOT_EXPORTED Node.js Origin: Application & API Last updated 14 Oct 2026

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

You imported a deep path inside a package that its package.json "exports" field doesn’t expose.

Exact message you may see is not defined by "exports"
Seen on: Node.js

Meaning

Packages with an exports map hide internal files. Deep imports that worked before an upgrade break, and old tooling (e.g. old webpack/postcss) may request unexported paths.

Common causes

  • Deep import into a package’s internals
  • Package upgraded and changed its exports
  • Old tool incompatible with the new package version

⚡ Quick fix

  1. Import from the documented public entry point
  2. Upgrade the tool that does the deep import
  3. Pin the previous package version if necessary

Detailed fix by platform

Node.js

  1. Check the package's package.json "exports" to see allowed subpaths

How to diagnose

  1. Path — Which subpath?
  2. Exports — What does the package expose?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

0x8007007E — 0x8007007E: The specified module could not be found (Windows)0x8007007EDEP0040 — DeprecationWarning: The `punycode` module is deprecated (DEP0040) (Node.js)DEP0040Dependency requires compileSdk — Dependency 'androidx.x:1.y' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs (Android)Dependency requires c…EBADENGINE — npm WARN EBADENGINE Unsupported engine / The engine "node" is incompatible with this module (Node.js)EBADENGINEERR_IMPORT_ATTRIBUTE_MISSING — TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module needs an import attribute of "type: json" (Node.js)ERR_IMPORT_ATTRIBUTE_…ERR_REQUIRE_ESM — Error [ERR_REQUIRE_ESM]: require() of ES Module not supported (Node.js)ERR_REQUIRE_ESMheld broken packages — Unmet dependencies / E: Unable to correct problems, you have held broken packages (Linux)held broken packagesMODULE_NOT_FOUND — Error: Cannot find module 'x' (MODULE_NOT_FOUND) (Node.js)MODULE_NOT_FOUNDERR_PACKA…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.