當我嘗試在我的離子專案中執行 ng add @angular/material 時,我遇到了如下錯誤。請讓我知道它試圖說什么?需要改變什么。這
npm ERR! node_modules/@angular/core
npm ERR! @angular/core@"~13.0.0" from the root project
npm ERR! peer @angular/core@"^13.0.0 || ^14.0.0-0" from @angular/[email protected]
npm ERR! node_modules/@angular/material
npm ERR! @angular/material@"13.1.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@"13.1.1" from @angular/[email protected]
npm ERR! node_modules/@angular/animations
npm ERR! peer @angular/animations@"^13.0.0 || ^14.0.0-0" from @angular/[email protected]
npm ERR! node_modules/@angular/material
npm ERR! @angular/material@"13.1.1" 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.```
uj5u.com熱心網友回復:
嘗試先npm install --legacy-peer-deps運行
uj5u.com熱心網友回復:
您的專案會自動為每個角度依賴項使用 angular 13 版本。Ionic 5 使用 angular 12 版本所以你應該使用 @angular/material 版本 12。從 package.json 檢查你的 ion-angular 版本,然后使用相同版本的 angular 材料。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/411212.html
標籤:
