'Types Error when run yarn build or tsc commands

enter image description hereWhen I try build project or run yarn tsc command I get some types error. Why this can happen? It looks like it is installing them in the wrong place. But why this can happen. I can give more detail if you need. [![enter image description here][2]][2]



Solution 1:[1]

You have multiple versions of react type definitions installed. Notice the two different roots of node_modules highlighted in the image below: enter image description here

Fix

You need to uninstall one of them otherwise the two definitions will conflict giving errors (as you have noticed).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 basarat