Error AtlasError Documentation and Resolution

Node.js blocked access to a package subpath that is not exported

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath is not defined by "exports"

Node.js found the package, but the requested subpath is not exposed through the package exports field, so the import is blocked.

ERR_PACKAGE_PATH_NOT_EXPORTEDmodules
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath is not defined by "exports"
  • The code imports a private internal file path inside a package.
  • A package added or tightened its exports field and removed the subpath you were using.
  • The runtime is using modern package exports rules that reject undeclared subpaths.
  1. Import the package through a documented public entry point instead of an internal subpath.
  2. Check the package exports map and update the import to a supported path.
  3. If needed, pin or upgrade the dependency version with a deliberate migration plan rather than relying on private internals.
Node.js Errors: ERR_PACKAGE_PATH_NOT_EXPORTED
Node.js ERR_PACKAGE_PATH_NOT_EXPORTED: causes and fixes | Error Atlas