In order to use the import syntax (ESModules), you need to set the following to your package.json:
{"type": "module" }
If you are using a version of Node earlier than 13, you need to use the --experimental-modules flag when you run the program
node --experimental-modules program.js
and add {"type": "module" } in package.json
Hope it helps !
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…