SyntaxError: Cannot use import statement outside a modu code example
Example: SyntaxError: Cannot use import statement outside a module
Node.js >= v13
Save the file with .mjs extension, &
Add { "type": "module" } in the nearest package.json.
(run npm init to create package.json)