To fix JavaScript ES6 TypeError: Class constructor Client cannot be invoked without ‘new’, we should set the build target to a recent version of JavaScript.
For instance, we write
{
//...
"compilerOptions": {
"target": "ES2017"
}
}
in tsconfig.json to set the TypeScript compiler build target to ES2017 to avoid transpilation of ES6 classes to ES5 constructor functions that cause this error.