NodeJS 控制台中的日志显示[12:06:59 PM]检测到文件更改,正在nestjs中启动增量编译

iaqfqrcu  于 2022-12-22  发布在  Node.js
关注(0)|答案(2)|浏览(68)

当我启动nest应用程序时,它成功启动并显示下面给出的日志。
我已经使用命令npm run dev:start启动了该项目。

[11:55:17 AM] File change detected. Starting incremental compilation...

[11:55:17 AM] Found 0 errors. Watching for file changes.

[Nest] 23860   - 05/19/2021, 11:55:18 AM   [NestFactory] Starting Nest application...
[Nest] 23860   - 05/19/2021, 11:55:18 AM   [InstanceLoader] AppModule dependencies initialized +106ms
[Nest] 23860   - 05/19/2021, 11:55:18 AM   [InstanceLoader] TypeOrmModule dependencies initialized +1ms
[Nest] 23860   - 05/19/2021, 11:55:18 AM   [InstanceLoader] TypeOrmCoreModule dependencies initialized +24ms
[Nest] 23860   - 05/19/2021, 11:55:18 AM   [RouterExplorer] Mapped {/auth/signup, POST} route +2ms
[Nest] 23860   - 05/19/2021, 11:55:18 AM   [RoutesResolver] PostController {/post}: +1ms
[Nest] 23860   - 05/19/2021, 11:55:18 AM   [RouterExplorer] Mapped {/post/create, POST} route +0ms
[Nest] 23860   - 05/19/2021, 11:55:18 AM   [RouterExplorer] Mapped {/post, GET} route +1ms
[Nest] 23860   - 05/19/2021, 11:55:18 AM   [RoutesResolver] CategoryController {/category}: +0ms
[Nest] 23860   - 05/19/2021, 11:55:18 AM   [RouterExplorer] Mapped {/category/create, POST} route +0ms
[Nest] 23860   - 05/19/2021, 11:55:18 AM   [NestApplication] Nest application successfully started +2ms
[Nest] 23860   - 05/19/2021, 11:55:18 AM   [bootstrap] Application started at localhost:5001

现在,如果我向端点发送任何请求,它将成功发送请求,数据将存储在数据库中,并返回数据,但问题是代码将重新编译并显示在控制台中

[12:06:59 PM] File change detected. Starting incremental compilation...

并且它不显示日志消息。我该如何修复此问题?

myzjeezk

myzjeezk1#

添加到您的tsconfig.json

"include": [
    "src"
]
yx2lnoni

yx2lnoni2#

如果以上不工作,这里是我如何修复这个问题

适用于NestJS

内部:json文件
增加“包括”:["./源代码”]
看起来像这样
tsconfig.build.json

{
      "extends": "./tsconfig.json",
      "exclude": ["node_modules", "test", "dist", "**/*spec.ts"],
      "include": ["./src"]
    }

相关问题