'require() of ES modules is not supported. ' error with Node.js, express, swagger-jsdoc
I solved this issue with downgrade swagger-jsdoc to 6.0.0
So, my package.json file now look like:
{ "name": "swaggertest", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "start": "nodemon app.js", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "express": "^4.17.1", "nodemon": "^2.0.7", "swagger-jsdoc": "6.0.0", "swagger-ui-express": "^4.1.6" }}