I am new to NodeJS.
I'm trying to write the following code for a NodeJS application (in src/index.ts):
import pptxgenjs from 'pptxgenjs';
const pres = new pptxgenjs();
But the Typescript compiler gives me the following error:
This expression is not constructable.
Type 'typeof import("########/node_modules/pptxgenjs/types/index")' has no construct signatures.
My tsconfig.json looks like this:
{
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext",
"target": "ES2020",
"sourceMap": true,
"outDir": "dist",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
},
"include": ["src/**/*"]
}
What can I do to resolve this?
It looks like I am using the exact same code on a typescript project and it works for me.
It is inside a NextJs typescript project.
Below is the beginning of my tsconfig.json file. Hope this helps.