【发布时间】:2021-12-30 14:43:00
【问题描述】:
我有一个使用 Fastify 的新 NestJS 应用程序。尝试npm run test:e2e 时出现以下错误:
[Nest] 14894 - 11/19/2021, 10:29:10 PM [ExceptionHandler] The "@nestjs/platform-express" package is missing. Please, make sure to install this library ($ npm install @nestjs/platform-express) to take advantage of NestFactory.
● process.exit called with "1"
12 | }).compile();
13 |
> 14 | app = moduleFixture.createNestApplication();
| ^
15 | await app.init();
16 | });
17 |
at Object.loadPackage (../node_modules/@nestjs/common/utils/load-package.util.js:13:17)
at TestingModule.createHttpAdapter (../node_modules/@nestjs/testing/testing-module.js:25:56)
at TestingModule.createNestApplication (../node_modules/@nestjs/testing/testing-module.js:13:43)
at Object.<anonymous> (app.e2e-spec.ts:14:25)
RUNS test/app.e2e-spec.ts
Process finished with exit code 1
看起来很奇怪,为什么基于 fastify 的应用需要 platform-express?
【问题讨论】:
标签: node.js typescript nestjs fastify nestjs-fastify