1. The ESM syntax is
 import {x} from 'module'
  1. To be able to use this syntax in Nodejs, we have several ways:

  2. Rename the file to .mjs
  3. Create package.json file and add: {“type”:”module”}
  4. Install this esm module: npm i -g esm

For the last choice, run node

node -r esm  ES-module-file.js