nestjs elasticSearch流/Web模块错误

gijlo24d  于 2022-11-02  发布在  ElasticSearch
关注(0)|答案(1)|浏览(157)
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

r7xajy2e

r7xajy2e1#

我也有这个问题,它看起来像在版本8.0.0的elasticsearch客户端,他们迁移到“undici”http客户端发布说明可以在这里找到
这可以用于代理option
至于变通方案,我已经将我的elasticsearch版本降级到最新版本,没有undici,即7.17.0

相关问题