Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Broken NPM dependencies #156

Closed
rstar2 opened this issue Apr 21, 2021 · 3 comments
Closed

[Bug] Broken NPM dependencies #156

rstar2 opened this issue Apr 21, 2021 · 3 comments

Comments

@rstar2
Copy link

rstar2 commented Apr 21, 2021

Version

1.9

Reproduction link

https://github.com/rstar2/material-dashboard-react

Operating System

Ubuntu 20.4

Device

Linux

Browser & Version

Steps to reproduce

  1. Clone the Github repo https://github.com/creativetimofficial/material-dashboard-react.git (or use the zip from CreativTim)
    2, Try "npm install"

What is expected?

The project to install

What is actually happening?

zzzz:~/work/react-mui-dashboard$ npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: @babel/core@7.9.0
npm ERR! node_modules/@babel/core
npm ERR! @babel/core@"7.9.0" from react-scripts@3.4.1
npm ERR! node_modules/react-scripts
npm ERR! react-scripts@"3.4.1" from the root project
npm ERR! @babel/core@"^7.4.5" from @svgr/webpack@4.3.3
npm ERR! node_modules/@svgr/webpack
npm ERR! @svgr/webpack@"4.3.3" from react-scripts@3.4.1
npm ERR! node_modules/react-scripts
npm ERR! react-scripts@"3.4.1" from the root project
npm ERR! 9 more (babel-jest, babel-loader, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @babel/core@"^7.13.0" from @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.13.12
npm ERR! node_modules/@babel/preset-env/node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining
npm ERR! @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@"^7.13.12" from @babel/preset-env@7.13.15
npm ERR! node_modules/@babel/preset-env
npm ERR! @babel/preset-env@"^7.4.5" from @svgr/webpack@4.3.3
npm ERR! node_modules/@svgr/webpack
npm ERR! @svgr/webpack@"4.3.3" from react-scripts@3.4.1
npm ERR! node_modules/react-scripts
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/rumen/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/rumen/.npm/_logs/2021-04-21T20_45_34_275Z-debug.log


Solution

I guess some dependencies versions incapabilities. I have similar results with the React Argon template

Additional comments

@rstar2
Copy link
Author

rstar2 commented Apr 21, 2021

Actually a little more search revealed the problem to be in NPM 7+ .
If someone else experience this see facebook/create-react-app#10749
In my case it's easier to install the project with yarn install

@rstar2 rstar2 closed this as completed Apr 21, 2021
@ryanzhou7
Copy link

ryanzhou7 commented Dec 18, 2021

I had a similar problem, tried with both node 14 and 16 (and their respective npm versions)

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! 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.

Fixed via installing with yarn as documented here

@sajadevo
Copy link
Collaborator

Hi Developers

For these sort of issues please use yarn.

All the best
Sajad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants