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"],
}

  




免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2026 CODEPRJ.COM