Description:
Requiring snappy/package.json directly fails with the following error:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" in snappy/package.json
Reproduction:
const path = "snappy/package.json";
try {
require(path);
} catch (err) {
console.error("Error:", err.message);
}
Expected Behavior:
require("snappy/package.json") should load the package.json file successfully.
Actual Behavior:
Node.js throws ERR_PACKAGE_PATH_NOT_EXPORTED because ./package.json is not listed in snappy’s "exports" field.
Environment:
- OS: macOS M1
- Node.js: v22.17.0
- Snappy: 7.3.2
Description:
Requiring
snappy/package.jsondirectly fails with the following error:Reproduction:
Expected Behavior:
require("snappy/package.json")should load the package.json file successfully.Actual Behavior:
Node.js throws
ERR_PACKAGE_PATH_NOT_EXPORTEDbecause./package.jsonis not listed in snappy’s"exports"field.Environment: