Транспортир. Список файлов в конфигурационном файле tsconfig.json пуст. (18002) - PullRequest
0 голосов
/ 07 января 2019

Я хочу реализовать e2e в своем проекте Angular v5.x, используя protractor.js . Но когда я запускаю команду

ng e2e -s false

Я получаю эту ошибку ниже, может кто-нибудь сказать мне, как я могу это исправить?

[15:58:11] E/launcher - Error: TSError: ⨯ Unable to compile TypeScript
The 'files' list in config file 'tsconfig.json' is empty. (18002)
    at load (F:\Commutatus\yop-v3\node_modules\ts-node\src\index.ts:159:13)
    at service (F:\Commutatus\yop-v3\node_modules\ts-node\src\index.ts:285:32)
    at shouldIgnore (F:\Commutatus\yop-v3\node_modules\ts-node\src\index.ts:293:21)
    at Object.require.extensions.(anonymous function) [as .ts] (F:\Commutatus\yop-v3\node_modules\ts-node\src\index.ts:302:11)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at F:\Commutatus\yop-v3\node_modules\protractor\node_modules\jasmine\lib\jasmine.js:84:5
[15:58:11] E/launcher - Process exited with error code 100

Вот мой tsconfig.json (который находится внутри папки e2e) -

{
  "compileOnSave": false,
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "module": "commonjs",
    "moduleResolution": "node",
    "outDir": "../dist/out-tsc-e2e",
    "sourceMap": true,
    "target": "es5",
    "typeRoots": [
      "../node_modules/@types"
    ]
  }
}

Ответы [ 2 ]

0 голосов
/ 16 января 2019

Что касается этой проблемы на GitHub, я нашел решение. Проблема с ts-node версией. Моя версия была 1.2.x и для работы ng e2e -s false нужна v5.0.1.

Версия >v5.0.1 также выдает ту же ошибку.

ПРИМЕЧАНИЕ: - Я не обновлял другие файлы или зависимости

Спасибо @ ashish701ranjan за решение

0 голосов
/ 07 января 2019

Использование свойства "files". Надеюсь, это поможет вам.

{
    "compilerOptions": {
        "module": "commonjs",
        "noImplicitAny": true,
        "removeComments": true,
        "preserveConstEnums": true,
        "sourceMap": true
    },
    "files": [
        "core.ts",
        "sys.ts",
        "types.ts",
        "scanner.ts",
        "parser.ts",
        "utilities.ts",
        "binder.ts",
        "checker.ts",
        "emitter.ts",
        "program.ts",
        "commandLineParser.ts",
        "tsc.ts",
        "diagnosticInformationMap.generated.ts"
    ]
}
...