Set NODE_PATH environment variable
By default, the packages installed by Yarn are not available on the node module path. This prevents parts of Antora from being required in a custom generator (without a secondary installation).
The simple solution is to assign the value $(yarn global dir)/node_modules
to the NODE_PATH environment variable inside the container. Once this is done, the following script will succeed:
const contentAggregator = require('@antora/content-aggregator')
This is a feature unique to Yarn since global packages are installed into a flat hierarchy.