React 工程编译出错提示错误:Duplicate identifier 'LibraryManagedAttributes'.的修改方法

现象:

Failed to compile.

(2818,14): Duplicate identifier 'LibraryManagedAttributes'.

Duplicate identifier问题的解决

修改方法:

1. 找到tsconfig.json文件

解决方案是在tsconfig.json的compilerOption中加入下面两项:

"skipLibCheck": true,
"allowSyntheticDefaultImports": true

12
完整例子:

{
	"compilerOptions": {
		"module": "commonjs",
		"target": "es6",
		"outDir": "out",
		"rootDir": "src",
		"sourceMap": true,
		"skipLibCheck": true,
		"allowSyntheticDefaultImports": true
	},
	"include": ["src"],
	"exclude": ["node_modules", ".vscode-test"],
}

  



原文地址:https://www.cnblogs.com/wzihan/p/13070297.html