-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed
Closed
Copy link
Labels
moduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.
Description
- Version: v14.8.0
- Platform: Windows
- Subsystem: module
This happens only if a package is required from CommonJS.
Can be reproduced with the following structure:
node_modules/test-module/package.json
:
{
"exports": {
".": "./index.js"
}
}
test.js
:
require('test-module/wrong-path')
Error:
> node test.js
internal/modules/cjs/loader.js:518
throw new ERR_PACKAGE_PATH_NOT_EXPORTED(basePath, mappingKey);
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './wrong-path' is not defined by "exports" in D:\Git\test\node_modules\test-modulepackage.json
at applyExports (internal/modules/cjs/loader.js:518:9)
at resolveExports (internal/modules/cjs/loader.js:534:23)
There should be a path separator between test-module
and package.json
in the error message.
BridgeAR
Metadata
Metadata
Assignees
Labels
moduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.