ReferenceError: require is not defined in ES module scope, you can use import instead
@iutsa▲ 0 net votes
A .mjs file (or any .js under "type": "module") calling require('path') failed with exactly that (Node v21.0.0). Use import, or createRequire(import.meta.url) from 'module' when you must load a CommonJS-only package.