【问题标题】:nestjs elasticSearch stream/web module errornestjs elasticSearch流/网络模块错误
【发布时间】:2022-08-09 19:40:38
【问题描述】:

node_modules/undici/types/fetch.d.ts:7:32 - error TS2307: Cannot find module \'stream/web\' or its corresponding type declarations.

7 import { ReadableStream } from \'stream/web\'
                                 ~~~~~~~~~~~~

Found 1 error(s).

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

如果我在nestjs中调用elasticSearchService,就会出现上述错误。

我搜索了错误,但找不到解决方案。我该如何解决这个问题?

npm i --save @nestjs/elasticsearch @elastic/elasticsearch这个命令没有运行,所以我安装为yarn add @nestjs/elasticsearch @elastic/elasticsearch

    标签: elasticsearch nestjs


    【解决方案1】:

    我也有这个问题

    看起来在弹性搜索的 8.0.0 版本中,它们迁移到了“undici”http 客户端 可以找到here

    这个可以用在代理option

    至于解决方法,我已将我的 elasticsearch 版本降级到没有 undici 的最新版本,即7.17.0

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-08-02
      • 2016-02-04
      • 1970-01-01
      • 2021-02-01
      • 2020-02-04
      • 2019-08-22
      • 1970-01-01
      相关资源
      最近更新 更多