add the "type": "module" line in your package.json code example Example: node package.json type module node --experimental-modules app.js