add "type":"module",
to package.json
to use import method
"name": "server",
"type": "module",
"version": "1.0.0",
add "start": "nodemon app.js",
to package.json
to auto run nodemon
"scripts": {
"start": "nodemon app.js",
"test": "echo \"Error: no test specified\" && exit 1"
},