This is because of the combination of two things:
-
tsconfig
not having anyfiles
section. From http://www.typescriptlang.org/docs/handbook/tsconfig-json.htmlIf no “files” property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories. When a “files” property is specified, only those files are included.
-
Including
typescript
as an npm dependency :node_modules/typescript/
This means that all oftypescript
gets included …. there is an implicitly includedlib.d.ts
in your project anyways (http://basarat.gitbook.io/typescript/content/docs/types/lib.d.ts.html) and its conflicting with the one that ships with the NPM version of typescript.
Fix
Either list files
or include
explicitly https://basarat.gitbook.io/typescript/docs/project/files.html 🌹