按@types安装react以后运行,
出现错误
(2632,14): error TS2300: Duplicate identifier 'Element'.
我把@types/react-dom和@types/react-router里的node_modules删除后就不报错了(这两个node_modules里又重复引用了@types/react)
看上去是重复依赖的问题,请问有什么配置的方法解决吗,
ts.config如下:
{
"compilerOptions": {
"noImplicitAny": false,
"removeComments": true,
"moduleResolution": "node",
"target": "es6",
"sourceMap": true,
"jsx": "react",
"types": ["node"],
"baseUrl": "./src",
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules"
]
}
orz..我现在webpack编译的时候也出现这个问题了