angularprotractore2e-testingangular-e2e

Protractor - The 'files' list in config file 'tsconfig.json' is empty. (18002)


I want to implement e2e in my Angular v5.x project using protractor.js. But when I run the command

ng e2e -s false

I'm getting this error below can anyone tell me how do I fix this?

[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

Here is my tsconfig.json (which is located inside e2e folder)-

{
  "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"
    ]
  }
}

Solution

  • With reference to this issue on GitHub, I've figured out the solution. The problem is with ts-node version. My version was 1.2.x and for ng e2e -s false to work it needs a v5.0.1.

    Version >v5.0.1 are also throwing the same error.

    NOTE:- I didn't update any other files or dependencies

    Thanks to @ashish701ranjan for the solution