KcAdminClient is not a constructor
lalrishav opened this issue · 1 comments
Getting below error when using
const kcAdminClient = new KcAdminClient();
as described in readme
using node version -> v12.17.0
npm version -> 6.14.4
"keycloak-admin": "^1.13.0"
(node:29132) UnhandledPromiseRejectionWarning: TypeError: KcAdminClient is not a constructor
at load (file:///Users/lalrishav/WebstormProjects/devops/script.js:9:27)
at file:///Users/lalrishav/WebstormProjects/devops/script.js:28:1
at ModuleJob.run (internal/modules/esm/module_job.js:110:37)
at async Loader.import (internal/modules/esm/loader.js:179:24)
(node:29132) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:29132) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
for those who are looking an element answer, when you require your kcadminclient
just add that
const KcAdminClient = require('keycloak-admin').default;