Skip to content

error TS6059: File 'xxx/node_modules/typescript/Gulpfile.ts' is not under 'rootDir' #10713

@GongT

Description

@GongT

TypeScript Version: nightly (2.1.0-dev.20160905)

Code
I'm not using gulp or other external tools

(the first line is not related to this issue)

[root /data/nodejs/json-env-cli]# tsc -w
error TS2688: Cannot find type definition file for './global.d.ts'.

error TS6059: File '/data/nodejs/json-env-cli/node_modules/typescript/Gulpfile.ts' is not under 'rootDir' '/data/nodejs/json-env-cli/src'. 'rootDir' is expected to contain all source files.

7:56:38 PM - Compilation complete. Watching for file changes.
{
    "compileOnSave": true,
    "compilerOptions": {
        "module": "commonjs",
        "target": "es6",
        "moduleResolution": "node",
        "noEmitOnError": false,
        "noImplicitThis": true,
        "noImplicitAny": false,
        "removeComments": false,
        "preserveConstEnums": true,
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "forceConsistentCasingInFileNames": true,
        "isolatedModules": false,
        "pretty": true,
        "sourceMap": true,
        "baseUrl": "./",
        "typeRoots": ["typings"],
        "types": ["./global.d.ts"],
        "lib": ["es6"],
        "outDir": "./dist",
        "rootDir": "./src"
    },
    "exclude": ["global.d.ts"]
}

Expected behavior:
ts file in "src" will compile to "dist", without error

Actual behavior:
files compiled but print an error

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions