After upgrading @keycloak/keycloak-admin-client version from 18.0.2 to 20.0.2 I started getting issues.
And as per the discussion on this issue https://github.com/keycloak/keycloak-nodejs-admin-client/issues/523#issuecomment-1222986081 They wont be going back to CommonJS Module Setup.
If anyone has implemented the workaround please help me with this issue