Skip to content
JS
Node.js error

ERR_UNSUPPORTED_DIR_IMPORT

import a directory URL is unsupported. Instead, self-reference a package using its name and define a custom subpath in the "exports" field of the package.json file. import './'; // unsupported import './index.js'; // supported import 'package-name'; // supported

Reference entryNode.jsFetched

Node.js documentation lists the code ERR_UNSUPPORTED_DIR_IMPORT without the printed message text.

Category
Node.js error codes
Severity
error
Runtime
node
or press Cmd/Ctrl + Enter. The text is only sent to this site to match it.
Source: Node.js documentation. Data fetched 2026-09-25T01:43:12.380Z.