Nestjs版本控制配置时使用快速

发布于 2025-02-13 10:54:53 字数 716 浏览 0 评论 0原文

出于相对复杂的Nestjs应用程序的性能原因,我们选择使用 fastify 作为我们的http Provider 。

我们处于需要版本的API阶段,并且在按照标准Nestjs 指南

  const app = await NestFactory.create<NestFastifyApplication>(
    AppModule,
    new FastifyAdapter(fastifyInstance),
    {},
  );

  app.enableVersioning();

收到的错误是:

Property 'enableVersioning' does not exist on type 'NestFastifyApplication'.ts(2339)

我无法在任何地方找到解决方案,并想我会问并看看其他人是否遇到了相同的问题并找到了解决方案。

For performance reasons of a relatively complex Nestjs application, we have chosen to use Fastify as our HTTP provider.

We are at a stage where we need to version out api and are running into problems after following instructions on the standard Nestjs guide:

  const app = await NestFactory.create<NestFastifyApplication>(
    AppModule,
    new FastifyAdapter(fastifyInstance),
    {},
  );

  app.enableVersioning();

The error received is:

Property 'enableVersioning' does not exist on type 'NestFastifyApplication'.ts(2339)

I haven't been able to find a solution anywhere and thought I'd ask and see if anyone else has had the same problem and found a solution.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南巷近海 2025-02-20 10:54:53

看起来您需要升级@nestjs/common,因为enableVersioning确实存在于nestfastifyapplication

  • https://github.com/nestjs/nest/blob/d5b6e4892090909090544a4a4a4f39c416b9800ca6a800ca6a8/packages/packages/common/common/interfaces/interfaces/nest-application.inest-application.interflication.interface.tss.tss.tsssspspsul47
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文