'Turning on the 'esModuleInterop' flag

I'm using Firebase Functions for my App. I installed these firebase functions on my PC but I can't use the following command:

Firebase deploy --only functions

I get the following error:

node_modules/google-gax/build/protos/iam_service.d.ts:17:23 - error TS2497: This module 
can only be referenced with ECMAScript imports/exports by turning on the 
'esModuleInterop' flag and referencing its default export.

17 import * as Long from 'long';
                       ~~~~~~

node_modules/google-gax/build/protos/operations.d.ts:17:23 - error TS2497: This module 
can only be referenced with ECMAScript imports/exports by turning on the 
'esModuleInterop' flag and referencing its default export.

17 import * as Long from 'long';
                         ~~~~~~

Found 2 errors in 2 files.

Errors  Files
 1  node_modules/google-gax/build/protos/iam_service.d.ts:17
 1  node_modules/google-gax/build/protos/operations.d.ts:17

Error: functions predeploy error: Command terminated with non-zero exit code2

Does anyone know how to turn on this flag?



Solution 1:[1]

just add "skipLibCheck": true to your tsconfig.json as shown below:

"compilerOptions": {
    "module": "commonjs",
    "noImplicitReturns": true,
    "noUnusedLocals": true,
    "outDir": "lib",
    "sourceMap": true,
    "strict": true,
    "target": "es2017",
    "skipLibCheck": true
  },

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 griffins