5

Tsconfig:

{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noEmitHelpers": true,
"lib": [
  "es6",
  "dom"
],
"types": [
  "hammerjs",
  "jasmine",
  "node",
  "selenium-webdriver",
  "webpack",
  "core-js",
  "google-maps"
]
},
"exclude": [
"node_modules"
"e2e"
],
"include": [
"src/**/*"
],
"filesGlob": [
"./src/**/*.ts",
"./test/**/*.ts",
"!./node_modules/**/*.ts",
"./src/custom-typings.d.ts"
],

}

When executing tsc I get following errors:

node_modules/@types/core-js/index.d.ts(262,5): error TS2687: All declarations of 'flags' must have identical modifiers. node_modules/@types/core-js/index.d.ts(276,5): error TS2687: All declarations of 'EPSILON' must have identical modifiers. node_modules/@types/core-js/index.d.ts(311,5): error TS2687: All declarations of 'MAX_SAFE_INTEGER' must have identical modifiers. node_modules/@types/core-js/index.d.ts(318,5): error TS2687: All declarations of 'MIN_SAFE_INTEGER' must have identical modifiers. node_modules/@types/core-js/index.d.ts(457,5): error TS2403: Subsequent variable declarations must have the same type. Variable '[Symbol.toStringTag]' must be of type '"Symbol"', but here has type 'string'. node_modules/@types/core-js/index.d.ts(457,5): error TS2687: All declarations of '[Symbol.toStringTag]' must have identical modifiers. node_modules/@types/core-js/index.d.ts(464,5): error TS2687: All declarations of 'prototype' must have identical modifiers. node_modules/@types/core-js/index.d.ts(492,5): error TS2687: All declarations of 'hasInstance' must have identical modifiers. node_modules/@types/core-js/index.d.ts(498,5): error TS2687: All declarations of 'isConcatSpreadable' must have identical modifiers. node_modules/@types/core-js/index.d.ts(504,5): error TS2687: All declarations of 'iterator' must have identical modifiers. node_modules/@types/core-js/index.d.ts(510,5): error TS2687: All declarations of

Why node_modules are not ignored when executing tsc command. I am using typescript in 2.0.3 version

1 Answer 1

4

Your tsconfig.json file lists core-js in the "types" property. This instructs the compiler to include node_module\@types\core-js. if you do not need it remove that entry.

See http://www.typescriptlang.org/docs/handbook/tsconfig-json.html#types-typeroots-and-types for more details about @types, and types in tsconfig.json.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.