Cannot find module "react-select/animated" while running strapi build

I ran into this problem as well when I was running locally in the middle of migrating from v3 to v4. At first, I got the error about missing react-select/animated. Just to see if it would work, I installed react-select as a dependency and things worked until I hit the same error twice but for different packages. First was style-loader and the second was css-loader. Once I added all those packages in, things worked fine. :woman_shrugging:t5:

Just as an experiment, I deleted all the .cache, build, and node_modules folders as well as the package-lock.json file and rebuilt everything. That time things worked straight away without having to do any other installs. So it seems like certain packages aren’t installing correctly.

4 Likes