He estado intentando descargar una plantilla para empezar a personalizarla. Al descargarlo, se supone que uno debe instalar todas las dependencias locales usando npm install o yarn install . He hecho ambas cosas y me ha dado el mismo error las dos veces. Además, he intentado usar el mismo comando con --force y --legacy-peer-deps , como se indica en el mensaje de error. Encontré un problema de GitHub que discutía este problema preciso y algunos otros subprocesos de desbordamiento de pila. He intentado todo lo que he encontrado, y simplemente no funciona. Además, he instalado la versión recomendada de node, por lo que ese tampoco es el problema, como se sugiere en otro hilo.
El mensaje de error se puede ver a continuación.
While resolving: @mui/material@5.2.0 npm ERR! Found: @emotion/react@11.4.1 npm ERR! node_modules/@emotion/react npm ERR! @emotion/react@"11.4.1" from the root project npm ERR! peer @emotion/react@"^11.0.0-rc.0" from @emotion/styled@11.3.0 npm ERR! node_modules/@emotion/styled npm ERR! @emotion/styled@"11.3.0" from the root project npm ERR! peerOptional @emotion/styled@"^11.3.0" from @mui/material@5.2.0 npm ERR! node_modules/@mui/material npm ERR! @mui/material@"5.2.0" from the root project npm ERR! 1 more (@mui/icons-material) npm ERR! 1 more (@mui/styled-engine) npm ERR! 1 more (@mui/styled-engine) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peerOptional @emotion/react@"^11.5.0" from @mui/material@5.2.0 npm ERR! node_modules/@mui/material npm ERR! @mui/material@"5.2.0" from the root project npm ERR! peer @mui/material@"^5.0.0" from @mui/icons-material@5.2.0 npm ERR! node_modules/@mui/icons-material npm ERR! @mui/icons-material@"5.2.0" from the root project npm ERR! npm ERR! Conflicting peer dependency: @emotion/react@11.7.1 npm ERR! node_modules/@emotion/react npm ERR! peerOptional @emotion/react@"^11.5.0" from @mui/material@5.2.0 npm ERR! node_modules/@mui/material npm ERR! @mui/material@"5.2.0" from the root project npm ERR! peer @mui/material@"^5.0.0" from @mui/icons-material@5.2.0 npm ERR! node_modules/@mui/icons-material npm ERR! @mui/icons-material@"5.2.0" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution.La plantilla: https://www.creative-tim.com/product/material-dashboard-react?ref=readme-mdr#
Problema de GitHub: https://github.com/creativetimofficial/material-dashboard-react/issues/171
Gracias por adelantado.
El problema es que la versión específica de @emotion/react utilizada en la plantilla ya no funciona.
Para solucionar el problema fui al package.json y cambié la versión de 11.4.1 a 11.5.0 manualmente. Parece que el 11.5.0 resuelve el problema con la plantilla utilizada.
actualice su versión desde el archivo package.json y ejecute nuevamente el comando "npm install"