簡體   English   中英

請幫忙,當我嘗試在我的 React 項目中安裝材料 UI 時遇到問題

[英]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> 8582980 安裝/材料@情感/反應@情感/風格

最新,在 41 秒內審核了 2099 個包

163包正在找資金跑npm fund詳情

27 個漏洞(16 個中等,9 個高,2 個嚴重)

要解決所有問題(包括重大更改),請運行:npm audit fix --force

運行npm audit了解詳情。 PS C:\Users\sammy waweru\Desktop\challanges\linked-in clone> npm i -S material-ui npm ERR:代碼 ERESOLVE npm ERR。 ERESOLVE 無法解析依賴關系樹 npm ERR。 npm ERR:解析時。 點擊我@0.1.0 npm 錯誤。 發現:react@17.0.2 npm ERR。 節點模塊/反應 npm 錯誤。 來自根項目的 react@"^17.0.2" npm ERR,npm ERR,無法解析依賴關系。 npm 錯誤:peer react@"^15.4.0 || ^16.0.0" from material-ui@0.20.2 npm 錯誤! node_modules/material-ui npm 錯誤! material-ui@"*" 來自根項目 npm ERR! npm 錯誤! 修復上游依賴沖突,或者重試 npm ERR! 此命令帶有 --force 或 --legacy-peer-deps npm ERR! 接受不正確(並且可能損壞)的依賴項解析。 npm 錯誤! npm 錯誤! 有關完整報告,請參閱 C:\Users\sammy waweru\AppData\Local\npm-cache\eresolve-report.txt。

npm ERR:此運行的完整日志可在以下位置找到: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>

在沒有其他依賴項的情況下安裝 @mui/material 並檢查它是否有效

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.

無法編譯。/src/HeaderOptions.js 未找到模塊:無法解析 'C:\Users\sammy waweru\Desktop\challanges\linked-in clone\src' 中的 '@mui/icons-material/Home' 這個在構建期間發生錯誤,無法解除。

這就是我的瀏覽器的響應方式

您可能正在使用不支持材料 ui 的反應版本。 嘗試:

npm 我 react@latest react-scripts@latest react-dom@latest

然后嘗試重新安裝材料ui

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM