ERR_PACKAGE_PATH_NOT_EXPORTED 🟩 Node.js

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.

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 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.