Using Node.js I got the following error: There was an error. Error [ERR_REQUIRE_ESM]: require() of ES Module /var/task/node_modules/dateformat/lib/dateformat.js from /var/task/node_modules/ws.js/lib/handlers/client/security/security.js not supported. Instead change the require of dateformat.js in /var/task/node_modules/ws.js/lib/handlers/client/security/security.js to a dynamic import() which is available in all CommonJS modules.
This happened after I was auto upgraded from Node.js 12.x version to 16.x. My skills use WCF.js which calls WS.js which calls security.js to call .NET web services.
Use fix esm https://www.npmjs.com/package/fix-esm module & import the module like this:
const someModule = require("fix-esm").require("some-module");
Otherwise you can downgrade the module version to a stable old version.