node_modules/@firebase/firestore/dist/index.d.ts:27:28 中出现错误 - 错误 TS1005:预期为“]”

2024-04-10

我尝试将 firebase 包含到我的角度应用程序中,我导入了所有内容,但是当我运行时ng serve我收到此错误:

ERROR in node_modules/@firebase/firestore/dist/index.d.ts:27:28 - error TS1005: ']' expected.

27     [K in keyof T & string as `${Prefix}.${K}`]+?: T[K];
                              ~~
node_modules/@firebase/firestore/dist/index.d.ts:27:47 - error TS1005: ';' expected.

27     [K in keyof T & string as `${Prefix}.${K}`]+?: T[K];
                                                 ~
node_modules/@firebase/firestore/dist/index.d.ts:27:49 - error TS1109: Expression expected.

27     [K in keyof T & string as `${Prefix}.${K}`]+?: T[K];
                                                   ~
node_modules/@firebase/firestore/dist/index.d.ts:27:50 - error TS1109: Expression expected.

27     [K in keyof T & string as `${Prefix}.${K}`]+?: T[K];
                                                    ~
node_modules/@firebase/firestore/dist/index.d.ts:28:1 - error TS1128: Declaration or statement expected.

28 };

我在互联网上搜索,发现了很多关于这方面的信息。

我尝试了以下操作:

  • 降级@angular/fire打包到6.1.5
  • 增加打字稿版本。
  • 重新安装node_modules.

我尝试了在互联网上找到的所有解决方案,但我不知道如何解决它。

我用的是 Angular 10。

这是我的package.json.

{
  "name": "xxxxxxxx",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~10.2.4",
    "@angular/cdk": "^10.2.7",
    "@angular/common": "~10.2.4",
    "@angular/compiler": "~10.2.4",
    "@angular/core": "~10.2.4",
    "@angular/fire": "^7.3.0",
    "@angular/forms": "~10.2.4",
    "@angular/material": "^10.2.7",
    "@angular/platform-browser": "~10.2.4",
    "@angular/platform-browser-dynamic": "~10.2.4",
    "@angular/router": "~10.2.4",
    "@datorama/akita-ng-entity-service": "^7.0.0",
    "@ngrx/store": "^10.1.2",
    "angularfire2": "^5.0.0-rc.7",
    "bootstrap": "^5.1.3",
    "firebase": "^9.0.2",
    "normalize.css": "^8.0.1",
    "rxjs": "~6.6.0",
    "sha1": "^1.1.1",
    "tslib": "^2.4.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1002.3",
    "@angular/cli": "~10.2.3",
    "@angular/compiler-cli": "~10.2.4",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.20.49",
    "codelyzer": "^6.0.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~5.0.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "protractor": "~7.0.0",
    "sass": "^1.50.1",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "^4.0.8"
  }
}


它对我有用

npm install typescript@latest
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

node_modules/@firebase/firestore/dist/index.d.ts:27:28 中出现错误 - 错误 TS1005:预期为“]” 的相关文章

随机推荐

  • Xcode Autolayout - 约束等于另一个约束

    我终于尝试在 IB 中采用自动布局 但在为某些对象设置约束时遇到问题 我基本上希望 5 个视图在整个超级视图中垂直均匀分布 我有 3 个按钮 由 2 行分隔 我希望间距 D1 D2 D3 和 D4 相等WITHOUT调整任何东西的高度 在I
  • Laravel 4 + AJAX 不工作

    我对 Laravel 4 很陌生 我正在尝试测试 AJAX 请求 In my script js我有这个 function login submit click function e e preventDefault return ajax
  • Ruby 模型的数组属性

    是否可以为数组类创建一个属性 我尝试阅读this https stackoverflow com questions 3438827 ruby model with an array as an attribute但我并没有从中得到太多 我
  • 无法在真实设备上的 iOS 10 上运行 Appium 测试

    自从将我的设备和 xCode 更新到 iOS 10 和 Xcode 8 以来 我一直无法在真实设备上成功设置 Appium 测试 不过 我在模拟器上运行得很好 以下是我的功能设置 DesiredCapabilities cap new De
  • Rails 表单动态添加字段

    我正在尝试设置一组字段以根据需要动态显示 在模型中 我有以下字段 attr accessible instruct1 instruct2 instruct30 我希望表单只显示 instruct1 并带有一个按钮来添加 1 个字段 直到击中
  • 在 Apex 类中引用远程站点设置 URL?

    我有一个 webservice 类 它将位于托管包中并分发给多个客户端 该类当前有一个变量 其中包含它所访问的服务器的硬编码值 问题 每个客户端的服务器都不同 因此硬编码值不起作用 我认为由于每个客户端都必须将其服务器添加到其远程站点设置中
  • 如何比较 MySQL 数据库模式 [关闭]

    Closed 这个问题是无关 help closed questions 目前不接受答案 我正在寻找一个可以让我比较 MySQL 数据库模式的工具 哪个是最好的工具来做到这一点 Navicat 能够为您做到这一点 它还将同步两个 mysql
  • AES加密/解密

    以下是一些适用于字符串的代码 Public Function AESEncrypt ByVal PlainText As String ByVal Password As String ByVal salt As String Dim Ha
  • 如何在“git Push”之后在本地和远程撤消“git commit”

    我已经表演过git commit随后是一个git push 如何在本地和远程存储库上恢复该更改 git log commit 364705c23011b0fc6a7ca2d80c86cef4a7c4db7ac8 Author Michael
  • 开源 Twitter 克隆(在 Ruby/Python 中)[关闭]

    Closed 此问题正在寻求书籍 工具 软件库等的推荐 不满足堆栈溢出指南 help closed questions 目前不接受答案 是否有任何用 Ruby 或 Python 编写的生产就绪的开源 Twitter 克隆 我对功能丰富的实现
  • 如何备份 Django 数据库

    我有一个使用 Postgres 数据库的 Django 应用程序 我需要能够备份和恢复数据库 既确保没有数据丢失 又能够在测试期间将数据从生产服务器复制到开发服务器 似乎有几种不同的方法可以做到这一点 只需直接与数据库交互即可 因此 对于
  • CKEditor 如何在取消帖子时删除服务器中的图像文件

    我正在使用nodeJS 后端 react 前端 mongoDB 我安装了 CKEditor5 以便在船上发布许多图像 它可以完美地在我的服务器文件夹上上传图像CKfinder But 如果有人停止发布上传的图像 无用的图像将保留在我的服务器
  • 警告:远程 HEAD 引用不存在的引用,无法结帐

    由于不同原因 这似乎是一个常见的错误 我有一个简单的裸 git 存储库 名为 kiflea git 我像这样克隆它 git clone git kipdola be kiflea git 然后 git 告诉我 warning remote
  • Mockito 3 any() 严格存根参数不匹配

    我正在使用 Mockito 3 1 0 我正在尝试用以下语法模拟我的方法 when mockedObject myMethod any HttpServletRequest class thenReturn 1 myMethod很简单 pu
  • 如何在 Strawberry Perl 中更改@INC?

    我该如何改变 INC永久地 而不改变我的脚本 在 Strawberry Perl 中 我知道 I 但不想每次都调用该开关 要添加路径 请将环境变量 PERL5LIB 设置为这些路径 注意 这将影响您运行的所有 Perl 安装 操作方法 右键
  • Task.FromResult() 与 Task.Run()

    我最近遇到过不少情况async方法同步执行 但无论如何都会返回一个任务 因此可以等待它们 例如 public virtual Task CreateAsync TUser user ThrowIfDisposed if user null
  • File.isFile() 返回错误结果? [复制]

    这个问题在这里已经有答案了 public class Test public static void isFile System out println new File D a log isFile public static void
  • 为什么不能在构造函数中实例化该类的同一对象?

    public class Run public static void main String args A a1 new A class A public A A a new A here as well A a new A 为什么这给出
  • 链表相对于数组有什么优点,反之亦然?

    请解释一下链表相对于数组的优点是什么 与链表相比 使用数组有什么优点吗 问候 舒阿布 两者都存储元素序列 但使用不同的技术 An array将元素按连续顺序存储在内存中 即如下所示 item 1 item 2 item 3 item x h
  • node_modules/@firebase/firestore/dist/index.d.ts:27:28 中出现错误 - 错误 TS1005:预期为“]”

    我尝试将 firebase 包含到我的角度应用程序中 我导入了所有内容 但是当我运行时ng serve我收到此错误 ERROR in node modules firebase firestore dist index d ts 27 28