ecronix / react-most-wanted

React starter kit with "Most Wanted" application features
https://www.react-most-wanted.com/
MIT License
2.43k stars 458 forks source link

rmw template fails to install "Conflicting peer dependency" #382

Closed douglasg14b closed 2 years ago

douglasg14b commented 2 years ago

WHen trying to run npx create-react-app my-app --template rmw

The following error eventually pops up:

Installing template dependencies using npm... npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: my-app@0.1.0 npm ERR! Found: react@18.0.0 npm ERR! node_modules/react npm ERR! peer react@"^18.0.0" from react-dom@18.0.0 npm ERR! node_modules/react-dom npm ERR! react-dom@"17.x" from the root project npm ERR! peer react-dom@"^17.0.0 || ^18.0.0" from @mui/lab@5.0.0-alpha.76 npm ERR! node_modules/@mui/lab npm ERR! @mui/lab@"^5.0.0-alpha.49" from the root project npm ERR! 1 more (@mui/material) npm ERR! peer react@">= 16" from react-scripts@5.0.0 npm ERR! node_modules/react-scripts npm ERR! react-scripts@"5.0.0" from the root project npm ERR! 6 more (the root project, @emotion/react, @emotion/styled, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! @mui/styles@"5.x" from the root project npm ERR! npm ERR! Conflicting peer dependency: react@17.0.2 npm ERR! node_modules/react npm ERR! peer react@"^17.0.0" from @mui/styles@5.6.0 npm ERR! node_modules/@mui/styles npm ERR! @mui/styles@"5.x" 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. npm ERR! npm ERR! See C:\Users\Douglas\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Douglas\AppData\Local\npm-cache_logs\2022-04-09T00_12_24_766Z-debug.log npm install --no-audit --save @emotion/react@11.x @emotion/styled@11.x @fontsource/roboto@4.x @mui/icons-material@5.x @mui/lab@^5.0.0-alpha.49 @mui/material@5.x @mui/styles@5.x base-shell@2.x chart.js@3.x final-form@^4.19.1 final-form-arrays@^3.0.2 react-final-form-arrays@^3.1.3 firebase@9.x firebaseui@6.x github-markdown-css@5.x intl@1.x jss-rtl@0.x material-ui-image@3.x material-ui-shell@3.x rmw-shell@11.x moment@2.x mui-rff@5.x notistack@2.x react@17.x react-beautiful-dnd@13.x react-chartjs-2@4.x react-countup@6.x react-custom-scrollbars-2@4.x react-dom@17.x react-easy-crop@4.x react-final-form@^6.5.1 react-helmet@6.x react-intl@5.x react-ios-pwa-prompt@1.x react-linkify@^1.0.0-alpha react-markdown@7.x react-router-dom@6.x react-virtualized-auto-sizer@1.x react-window@1.x @testing-library/jest-dom@^5.11.4 @testing-library/react@^12.1.0 @testing-library/user-event@^13.1.10 failed

TarikHuber commented 2 years ago

Have you tried to run it with npm i --force ? The newest node and npm version have more strict peer dependency rules.

douglasg14b commented 2 years ago

Is that advisable if there are incompatible dependencies?

TarikHuber commented 2 years ago

With such an amount of peer dependencies it is hard for me to keep them up to date. As long as the main versions are compatible it is fine. You can update and downgrade each peer until you get them right. That is the reason they are peer dependencies and not direct one to give everyone the ability to adjust the project how he wants. I use --force quite often in more projects because it yeals even for the smallest mismatch of version that is more a formal one because someone forgot to update a strict dependency in his project that we use and the it makes a problem on our side.

douglasg14b commented 2 years ago

gotcha.

Thanks for the responses!