首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在配置文件'tsconfig.json‘中没有找到输入。指定的“包括”路径位于角6

在配置文件'tsconfig.json‘中没有找到输入。指定的“包括”路径位于角6
EN

Stack Overflow用户
提问于 2018-09-21 11:01:30
回答 1查看 11.9K关注 0票数 3

我正在升级我的角4到角6应用程序。在构建我的应用程序时,我会得到以下错误。

代码语言:javascript
复制
error TS18003: No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were '["../../node_modules/@wtw/**/*"]' and 'exclude' paths were '["**/*.sp
ec.ts","**/*.stub.ts","test/**/*.ts"]'.

Error: error TS18003: No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were '["../../node_modules/@wtw/**/*"]' and 'exclude' paths were '["
**/*.spec.ts","**/*.stub.ts","test/**/*.ts"]'.

如果我将"**/*“添加到include中,则会得到以下错误,而上面的错误则不正确。

代码语言:javascript
复制
ERROR in e2e/app.e2e-spec.ts(3,1): error TS2304: Cannot find name 'describe'.
e2e/app.e2e-spec.ts(6,3): error TS2304: Cannot find name 'beforeEach'.
e2e/app.e2e-spec.ts(10,3): error TS2304: Cannot find name 'it'.
e2e/app.e2e-spec.ts(12,5): error TS2304: Cannot find name 'expect'.

tsconfig

代码语言:javascript
复制
{
  "compileOnSave": false,

  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "baseUrl": "src",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types",
      "type-definition"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  },

  "include": [
    "../node_modules/@wtw/**/*",
    "**/*"
  ]
}

我该如何解决这个问题。

EN

回答 1

Stack Overflow用户

发布于 2018-11-09 09:22:23

由于错误显示‘’路径为“__/.”、“test/**/*. to”,因此需要在目录或子目录中有一个*.ts文件,在该目录或子目录中,tsconfig.app.json文件包含声明的包含属性和排除属性。

“包含”和“排除”属性接受一个类似glob文件模式的列表。支持的glob通配符是:

  • “*”匹配零或多个字符(不包括目录分隔符)
  • “?”匹配任意一个字符(不包括目录分隔符)
  • '**/‘递归匹配任何子目录

如果一个glob模式的一个片段只包含*或.*,那么只包含具有受支持扩展名的文件(例如,.ts、.tsx和.d.ts默认情况下与.js和.jsx一起使用,如果allowJs设置为true)。

您可以参考这个以获得更多帮助。

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52442315

复制
相关文章

相似问题

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