简体   繁体   中英

Kindly help,am having issues when I try to install material UI in my react project

npm ERR: C.\Users\sammy waweru\AppData\Local\npm-cache_logs\2021-11-19T09_14_33_601Z-debug:log PS C:\Users\sammy waweru\Desktop\challanges\linked-in clone> npm install @mui/material @emotion/react @emotion/styled

up to date, audited 2099 packages in 41s

163 packages are looking for funding run npm fund for details

27 vulnerabilities (16 moderate, 9 high, 2 critical)

To address all issues (including breaking changes), run: npm audit fix --force

Run npm audit for details. PS C:\Users\sammy waweru\Desktop\challanges\linked-in clone> npm i -S material-ui npm ERR: code ERESOLVE npm ERR. ERESOLVE unable to resolve dependency tree npm ERR. npm ERR: While resolving. click-me@0.1.0 npm ERR. Found: react@17.0.2 npm ERR. node_modules/react npm ERR. react@"^17.0.2" from the root project npm ERR, npm ERR, Could not resolve dependency. npm ERR: peer react@"^15.4.0 || ^16.0.0" from material-ui@0.20.2 npm ERR! node_modules/material-ui npm ERR! material-ui@"*" 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\sammy waweru\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\sammy waweru\AppData\Local\npm-cache_logs\2021-11-19T09_16_16_671Z-debug.log PS C:\Users\sammy waweru\Desktop\challanges\linked-in clone>

install @mui/material without the other depandencies and check if it work

PS C:\Users\sammy waweru\Desktop\challanges\linked-in clone> npm install @material-ui/core added 20 packages, and audited 2119 packages in 4m 167 packages are looking for funding run `npm fund` for details 27 vulnerabilities (16 moderate, 9 high, 2 critical) To address all issues (including breaking changes), run: npm audit fix --force Run `npm audit` for details. PS C:\Users\sammy waweru\Desktop\challanges\linked-in clone> npm install @mui/material up to date, audited 2119 packages in 40s 167 packages are looking for funding run `npm fund` for details 27 vulnerabilities (16 moderate, 9 high, 2 critical) To address all issues (including breaking changes), run: npm audit fix --force Run `npm audit` for details.

Failed to compile./src/HeaderOptions.js Module not found: Can't resolve '@mui/icons-material/Home' in 'C:\Users\sammy waweru\Desktop\challanges\linked-in clone\src' This error occurred during the build time and cannot be dismissed.

this is how my browser is responding

You are probably using a react version that doesn't support material ui. Try:

npm i react@latest react-scripts@latest react-dom@latest

then try re-installing material ui

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM