3
votes

After I upgraded to Typescript 2.9.1 (from 2.8) I got compile error said

node_modules/typescript/lib/lib.es2017.full.d.ts:33:11 - error TS2300: Duplicate identifier 'Account'.

This is never happened when I was using typescript 2.7 and 2.8.

Environment:

  • MacOS 10.13.5
  • Node.js v9.11.1
  • NPM: 6.1.0
  • Typescript 2.9.1 (in my project's node_modules folder and no global typescript)
// tsconfig.json
{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es2017",
    "noImplicitAny": true,
    "moduleResolution": "node",
    "sourceMap": true,
    "outDir": "ts-build",
    "baseUrl": ".",
    "paths": {
      "kernel/*": [
        "./server/kernel/*"
      ]
    },
    "rootDir": ".",
    "allowJs": true,
    "typeRoots": [
      "node_modules/@types"
    ],
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "types": [],
    "keyofStringsOnly": true
  },
  "include": [
    "server/**/*",
    "app.*.js"
  ],
  "exclude": [
    "node_modules"
  ]
}
1

1 Answers

1
votes

Just a workaround, I'm using skipLibCheck: true to bypass the type check in lib files so there's no error. But I still don't know why this happen in 2.9.1.