Setting null on an export path can be used to exclude private directories from being exposed (Node.js docs):
// ./node_modules/package/package.json
{
"exports": {
"./*": "./*",
"./internal/*": null
}
}Although this works to prevent an import like this:
import 'package/internal/file.js'It can be circumvented by using multiple slashes:
import 'package//internal/file.js'In UNIX, multiple consecutive slashes are treated as a single slash.
-
Install appropriate Node.js version with nvm:
nvm i -
Run command:
npm start