Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot install @material-ui/core using npm

I tried to install @material-ui/core librabry but then npm throws the error below

I used the

npm install @material-ui

command

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from @material-ui/[email protected]
npm ERR! node_modules/@material-ui/core
npm ERR!   @material-ui/core@"*" 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/freduah/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/freduah/.npm/_logs/2020-11-02T14_50_03_045Z-debug.log
freduah@freduah:~/school-demo$ ```
like image 437
Freduah Gideon Avatar asked Oct 23 '25 17:10

Freduah Gideon


2 Answers

I had come across the same problem. These worked for me:

  1. For core: npm -f install @material-ui/core

  2. For icons: npm -f install @material-ui/icons

like image 63
Shree Avatar answered Oct 27 '25 01:10

Shree


You can try to install it by force by adding '-f':

npm install -f @material-ui/core
like image 34
Raahim Avatar answered Oct 27 '25 02:10

Raahim