How to solve the error of
SyntaxError: Cannot use import statement outside a module
In an external dependency? I am using typorm and it is throwing error because of this package inside the docker container. Locally, everything is working fine. I cannot use type = 'module' because i am using typescript compiling my code with target: "es5"
My tsconfig:
{
"compilerOptions": {
"target": "es5",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"skipLibCheck": true,
"declaration": true,
"esModuleInterop": true,
"noImplicitAny": false,
"outDir": "./dist",
"baseUrl": ".",
"rootDir": ".",
}
}
Node version: 17