typescript - node_modules/firebase-functions/lib/function-configuration.d.ts :4:64 - error TS1005: ']' expected

标签 typescript firebase google-cloud-functions

在我的 Ionic 3 项目中执行命令 firebase deploy --only function 时出现以下错误。 This solution对我不起作用。

Running command: npm --prefix "$RESOURCE_DIR" run build
> functions@ build /Users/myuser/Project/functions
> tsc

node_modules/firebase-functions/lib/function-configuration.d.ts:4:64 - error TS1005: ']' expected.
4 export declare const SUPPORTED_REGIONS: readonly ["us-central1", "us-east1", "us-east4", "europe-west1", "europe-west2", "asia-east2", "asia-northeast1"];
                                                                             ~

node_modules/firebase-functions/lib/function-configuration.d.ts:4:66 - error TS1134: Variable declaration expected.
4 export declare const SUPPORTED_REGIONS: readonly ["us-central1", "us-east1", "us-east4", "europe-west1", "europe-west2", "asia-east2", "asia-northeast1"];
                                                                   ~~~~~~~~~~

node_modules/firebase-functions/lib/function-configuration.d.ts:4:153 - error TS1005: ';' expected.
4 export declare const SUPPORTED_REGIONS: readonly ["us-central1", "us-east1", "us-east4", "europe-west1", "europe-west2", "asia-east2", "asia-northeast1"];
                                                                                                                                                          ~

node_modules/firebase-functions/lib/function-configuration.d.ts:16:61 - error TS1005: ']' expected.
16 export declare const VALID_MEMORY_OPTIONS: readonly ["128MB", "256MB", "512MB", "1GB", "2GB"];
                                                               ~

node_modules/firebase-functions/lib/function-configuration.d.ts:16:63 - error TS1134: Variable declaration expected.
16 export declare const VALID_MEMORY_OPTIONS: readonly ["128MB", "256MB", "512MB", "1GB", "2GB"];
                                                                 ~~~~~~~

node_modules/firebase-functions/lib/function-configuration.d.ts:16:93 - error TS1005: ';' expected.
16 export declare const VALID_MEMORY_OPTIONS: readonly ["128MB", "256MB", "512MB", "1GB", "2GB"];
                                                                                               ~

当我查看文件 node_modules/firebase-functions/lib/function-configuration.d.ts 时,它显示语法错误。


版本详情:

"angularfire2": "^5.2.1",
"firebase": "^6.3.1",
"firebase-admin": "^8.2.0",
"firebase-functions": "3.2.0",
"typescript": "^3.5.3"

最佳答案

npm install -g typescript@3.5.3 对我有用。我假设更高版本也可以。更新全局 typescript 版本很重要,因为我的本地 typescript 版本更新不起作用

关于typescript - node_modules/firebase-functions/lib/function-configuration.d.ts :4:64 - error TS1005: ']' expected,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57242813/

相关文章:

javascript - 使用 'beforeunload'/'unload' eventlistener 关闭浏览器后使用 Fetch 发送 POST 请求不起作用

swift - 在我的 iPhone 上没有收到推送通知,但 Firebase Functions 说它已成功发送?

javascript - Leaflet customcontrol - Angular 2+

angularjs - 在新的@angular/router 3.0.0-alpha.3 中找不到 provideRouter 和 RouterConfig^

typescript - jest-mock-extended - 使用对象输入调用模拟 [Typescript]

Swift - 如何允许人们设置自己的 Firebase 后端?

java - Android Google 登录失败 com.google.android.gms.common.api.ApiException : 12500

angular - 如何在运行时向页面添加元素

android - 'com.google.gms.google-services'插件与android应用程序集成时出现问题

ios - 可以在 iPad 上编辑 Firebase Cloud Functions 并部署更改吗?