重现步骤:
1)npm install @types/mocha @types/jasmine
2)tsc
node_modules/@types/jasmine/index.d.ts(9,18): error TS2300: Duplicate identifier 'describe'.
node_modules/@types/jasmine/index.d.ts(11,18): error TS2300: Duplicate identifier 'xdescribe'.
...
node_modules/@types/mocha/index.d.ts(33,13): error TS2300: Duplicate identifier 'describe'.
node_modules/@types/mocha/index.d.ts(34,13): error TS2300: Duplicate identifier 'xdescribe'.
...
我的项目结构:
node_modules
test.ts
tsconfig.json
我的代码:
const a: number = 9;
我的tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node"
}
}
答案 0 :(得分:5)
找到它。使用types
中的tsconfig.json
选项以及tsc
版本2.x
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"types": []
}
}