Well you’ve told Node that romodule is an actual spec-compliant JS module, then you’ve tried to use it as a CommonJS module. The solution would be to not instruct Node that romodule is an ESModule by using the correct extension
Is what you posted above the entirety of your code? If it is, then you aren’t exporting anything at all so everything in each module is private. If it is not the entirety of your code then it’s a little difficult to provide help as we can’t see what you can see on your screen.
JS didn’t have module system, it didn’t exist.
Node needed a module system, so the designers of Node wrote one.
Alternative to CommonJS was no modules at all, which wouldn’t have been at all practical.
I didn’t?? The alternative to having the module system Node has was not having modules. JavaScript did not have any form of standarised module system, there was literally no choice but to create one.
You asked what the point was of introducing CommonJS modules. The point was that they needed modules, if they didn’t create a module system then they wouldn’t have had modules.
Again, though, it’s extremely hard to see exactly what you’re doing wrong here without any code.