comedy icon indicating copy to clipboard operation
comedy copied to clipboard

tsc compile error

Open wujianv5 opened this issue 6 years ago • 1 comments

When I run tsc, the compiler tells:

xxx/AppData/Roaming/npm/node_modules/typescript/lib/lib.es2015.iterable.d.ts:41:6 - error TS2300: Duplicate identifier 'IteratorResult'.

41 type IteratorResult<T, TReturn = any> = IteratorYieldResult<T> | IteratorReturnResult<TReturn>; ~~~~~~~~~~~~~~

node_modules/@types/node/index.d.ts:165:11 165 interface IteratorResult<T> { } ~~~~~~~~~~~~~~ 'IteratorResult' was also declared here.

And my tsconfig.json is:

{ "exclude": [ "node_modules/@types/node/index.d.ts" ], "compilerOptions": { "target": "es5", "module": "commonjs", "lib": ["es6"], "strict": true, "esModuleInterop": true } }

Typescript version is 3.7.2

The "exclude" in tsconfig.json makes no difference.

wujianv5 avatar Nov 19 '19 11:11 wujianv5

Hi @wujianv5 ! You should use the version of TypeScript that is configured in package.json, it's the only one that is being tested.

weekens avatar Nov 26 '19 05:11 weekens