could not resolver a few dependencies
Closed this issue · 5 comments
❯ create-react-app aa_congresses_admin --template material-ui
Creating a new React app in /Users/cesaralbertotrejojuarez/aiesec_alumni/firebase/aa_congresses_admin.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template-material-ui...
added 1931 packages, and audited 1932 packages in 31s
124 packages are looking for funding
run npm fund
for details
found 0 vulnerabilities
Initialized a git repository.
Installing template dependencies using npm...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: aa_congresses_admin@0.1.0
npm ERR! Found: @formatjs/intl-relativetimeformat@7.3.6
npm ERR! node_modules/@formatjs/intl-relativetimeformat
npm ERR! @formatjs/intl-relativetimeformat@"7.x" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @formatjs/intl-relativetimeformat@"8.x" from base-shell@1.2.20
npm ERR! node_modules/base-shell
npm ERR! base-shell@"1.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 /Users/cesaralbertotrejojuarez/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/cesaralbertotrejojuarez/.npm/_logs/2021-02-09T05_13_39_826Z-debug.log
npm install --save jss-rtl@0.x @formatjs/intl-relativetimeformat@7.x @material-ui/core@4.x @material-ui/icons@4.x base-shell@1.x material-ui-shell@1.x github-markdown-css@4.x intl@1.x intl-locales-supported@1.x notistack@1.x react@17.x react-custom-scrollbars@4.x react-dom@17.x react-intl@5.x react-ios-pwa-prompt@1.x react-markdown@5.x react-router-dom@5.x react-virtualized-auto-sizer@1.x react-window@1.x
failed
It looks like you have a older create-react-app
version. If you run it without the npx
it will use the one localy installed on your device without any update on it. Try to uninstall your global CRA
and run the command from our homepage with npx
I get the same error using npx, with node 14 and npm/x 7:
scdf@EDGELORD:~/Code/SCdF$ node -v
v14.15.4
scdf@EDGELORD:~/Code/SCdF$ npm -v
7.5.4
scdf@EDGELORD:~/Code/SCdF$ npx -v
7.5.4
scdf@EDGELORD:~/Code/SCdF$ npx create-react-app example --template material-ui
Creating a new React app in /home/scdf/Code/SCdF/example.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template-material-ui...
added 1934 packages, and audited 1935 packages in 26s
125 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Initialized a git repository.
Installing template dependencies using npm...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: example@0.1.0
npm ERR! Found: @formatjs/intl-relativetimeformat@7.3.6
npm ERR! node_modules/@formatjs/intl-relativetimeformat
npm ERR! @formatjs/intl-relativetimeformat@"7.x" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @formatjs/intl-relativetimeformat@"8.x" from base-shell@1.2.20
npm ERR! node_modules/base-shell
npm ERR! base-shell@"1.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 /home/scdf/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/scdf/.npm/_logs/2021-02-17T10_53_23_274Z-debug.log
`npm install --save jss-rtl@0.x @formatjs/intl-relativetimeformat@7.x @material-ui/core@4.x @material-ui/icons@4.x base-shell@1.x material-ui-shell@1.x github-markdown-css@4.x intl@1.x intl-locales-supported@1.x notistack@1.x react@17.x react-custom-scrollbars@4.x react-dom@17.x react-easy-crop@3.x react-intl@5.x react-ios-pwa-prompt@1.x react-markdown@5.x react-router-dom@5.x react-virtualized-auto-sizer@1.x react-window@1.x` failed
OK interesting, I got it to work on the latest LTS of node (14.15.5) with the provided npm version (6.14.11). If I then upgrade to the latest npm (7.5.4) it breaks with the error above.
The latest npm version tries to install peer dependencies and the older one just informs you about them. The peer dependencies are setup in the project just for info and not as installation instruction. No wonder it breaks with latest npm :(
Param --legacy-peer-deps helps me:
npx --legacy-peer-deps create-react-app example --template material-ui