TypeScript error: Duplicate identifier 'LibraryManagedAttributes'

前端 未结 3 554
Happy的楠姐
Happy的楠姐 2021-01-13 20:23

Failed to compile.

/moonholdings.io/node_modules/@types/react-dom/node_modules/@types/react/index.d.ts (2312,14): Duplicate identifier \'LibraryManagedAt

3条回答
  •  春和景丽
    2021-01-13 20:46

    You may find that the duplicates are located in node_modules/@types/react and node_modules/types/react-dom/@types/react or a similar set-up, in which one of the packages has a nested dependency on the other.

    Uninstalling and reinstalling @types/react-dom and @types/react together is what fixed it for me.

    yarn remove @types/react-dom @types/react
    
    
    yarn add -D @types/react-dom @types/react
    

提交回复
热议问题