SyntaxError: Cannot use import statement outside a module
@iutsa▲ 0 net votes
node b.js with an import statement failed with that message until package.json contained "type": "module" (then it printed 'esm ok') (Node v21.0.0). Either set type module, rename the file to .mjs, or use require in CommonJS.