首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ts-node-dev不打印ts错误

ts-node-dev不打印ts错误
EN

Stack Overflow用户
提问于 2020-04-30 12:42:04
回答 1查看 116关注 0票数 0

我使用ts-node-dev来编译和运行我的节点应用程序。

ts-node-dev -r tsconfig-paths/register src/collectDayMatches.ts

但是ts-node-dev打印只是运行时错误(而不是ts错误)。

如果我在构建应用程序中使用tsc,我会得到预期的错误。

tsconfig.json:

代码语言:javascript
复制
{
  "compilerOptions": {
    "target": "es2019",
    "module": "commonjs",
    "moduleResolution": "node",
    "outDir": "dist",
    "strict": true,
    "inlineSourceMap": true,
    "noImplicitAny": true,
    "noImplicitReturns": true,
    "strictNullChecks": true,
    "noImplicitThis": true,
    "alwaysStrict": true,
    "allowJs": false,
    "lib": ["es2016", "esnext.asynciterable", "webworker"],
    "types": ["node"],
    "allowSyntheticDefaultImports": true,
    "strictPropertyInitialization": false,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "forceConsistentCasingInFileNames": true,
    "pretty": true,
    "baseUrl": "./src",
    "paths": {
      "utils/*": ["utils/*"]
    }
  }
}
EN

回答 1

Stack Overflow用户

发布于 2021-01-28 10:57:27

我也遇到了同样的问题,因为我将--transpile-only传递给ts-node-dev。当我删除--transpile-only时,正在打印TypeScript错误,并且编译中断。

忽略TypeScript错误:

代码语言:javascript
复制
ts-node-dev --respawn --transpile-only -r tsconfig-paths/register src/index.ts

报告TypeScript错误:

代码语言:javascript
复制
ts-node-dev --respawn -r tsconfig-paths/register src/index.ts
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61516059

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档