You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
This happens only if a package is required from CommonJS.
Can be reproduced with the following structure:
node_modules/test-module/package.json
:test.js
:Error:
There should be a path separator between
test-module
andpackage.json
in the error message.The text was updated successfully, but these errors were encountered: