打开'esModuleInterop'标志



我正在为我的应用程序使用Firebase功能。我在我的PC上安装了这些Firebase功能,但我不能使用以下命令:

Firebase deploy——only functions

我得到以下错误:

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

有人知道如何打开这个标志吗?

"skipLibCheck": true添加到tsconfig.json中,如下所示:

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

相关内容

  • 没有找到相关文章

最新更新