In case it helps someone else, I was getting many errors running tsc with the hubspot nodejs library like:
node_modules/@hubspot/api-client/lib/codegen/cms/audit_logs/api/defaultApi.d.ts:13:8 - error TS1192: Module '"http"' has no default export.
13 import http from 'http';
and
./node_modules/@hubspot/api-client/lib/codegen/cms/audit_logs/model/models.d.ts:7:8 - error TS1259: Module '"/home/philc/node_projects/fut-skills/hubspot/node_modules/@types/request/index"' can only be default-imported using the 'esModuleInterop' flag
I was able to resolve this by modifying my tsconfig.json file to add the compiler option esModuleInterop so it looked like this:
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"sourceMap": true,
"outDir": "./dist",
"strict": true,
"noUnusedLocals": true,
"esModuleInterop": true,
},
"include": [
"app.ts",
"config.ts",
"types.ts",
"src/**/*",
"lib/**/*"
],
"exclude": ["./node_modules"]
}
Phil