我有一個關于ionic、npm ecc的問題。
我想用Ionic框架撰寫一個使用Angular的應用程式。
我安裝了Node.js, ionic, angular, @ionic/angular, native-run, cordova-res, @capacitor/camera, @capacitor/storage, @capacitor/filesystem。
但當我把命令ionic start時,輸出結果是這樣的:
我試著在google上搜索了一下,但沒有找到任何東西。我不知道是我忘記了一些軟體包,還是我錯了什么。
uj5u.com熱心網友回復: 你有不兼容的依賴, 你安裝了 你需要改變這一點,以便它們能夠被解決。在沒有看到你的package.json.
標籤:?
? 啟動模板:sidemenu
√ 在1.97ms內準備目錄.ludolambru
√ 在367.60ms內下載并提取sidemenu啟動器
> ionic集成啟用電容 --quiet -- ludolambru io.ionic.starter
> npm.cmd i --save -E @capacitor/core@latest
npm ERR!代碼 ERESOLVE
npm ERR! ERESOLVE 無法解決依賴關系樹的問題
npm ERR!
npm ERR! 解決時:[email protected]
npm ERR! 找到了。@angular/[email protected]
npm ERR!node_modules/@angular/compiler
npm ERR!dev @angular/compiler@"~12.1.1 "來自根專案。
npm ERR!peer @angular/compiler@"12.1.5" from @angular/[email protected]
npm ERR!node_modules/@angular/compiler-cli
npm ERR!dev @angular/compiler-cli@"~12.1.1" from the root project
npm ERR!peer @angular/compiler-cli@"^12.0.0 || ^12.1.0-next" from @angular-devkit/[email protected]
npm ERR!node_modules/@angular-devkit/build-angular
npm ERR!dev @angular-devkit/build-angular@"~12.1.1" from the root project
npm ERR!
npm ERR! 無法解決依賴關系。
npm ERR! peer @angular/compiler@"12.2.6" from @angular/[email protected]
npm ERR!node_modules/@angular/localize
npm ERR!peerOptional @angular/localize@"^12.0.0 || ^12.1.0-next" from @angular-devkit/[email protected]
npm ERR!node_modules/@angular-devkit/build-angular
npm ERR!dev @angular-devkit/build-angular@"~12.1.1" from the root project
npm ERR!
npm ERR! 修復上游依賴性沖突,或者重試
npm ERR!使用 --force 或 --legacy-peer-deps 命令。
npm ERR! 接受一個不正確的(可能是壞的)依賴關系決議。
npm ERR!
npm ERR! 見C:UserslatinAppDataLocal
pm-cacheeresolve-report.txt的完整報告。
npm ERR! 中可以找到本次運行的完整日志。
npm ERR! C:UserslatinAppDataLocal
pm-cache\_logs2021-09-17T09_15_32_264Z- debug.log
[ERROR] 在運行子行程npm時發生了一個錯誤。
npm.cmd i --save -E @capacitor/core@latest退出,退出代碼為1。
用 --verbose 標志重新運行此命令可能會提供更多資訊。
安裝依賴項可能需要數分鐘。
──────────────────────────────────────────────────────────────
Ionic Appflow,Ionic的移動DevOps解決方案
持續地構建、部署和運送應用程式
專注于構建應用程式,其余部分由我們自動完成
了解更多:https://ion.link/appflow
──────────────────────────────────────────────────────────────
> npm.cmd i
npm ERR!代碼 ERESOLVE
npm ERR! ERESOLVE無法解決依賴樹的問題
npm ERR!
npm ERR! 解決時:[email protected]
npm ERR! 找到了。@angular/[email protected]
npm ERR!node_modules/@angular/compiler
npm ERR!dev @angular/compiler@"~12.1.1 "來自根專案。
npm ERR!peer @angular/compiler@"12.1.5" from @angular/[email protected]
npm ERR!node_modules/@angular/compiler-cli
npm ERR!dev @angular/compiler-cli@"~12.1.1" from the root project
npm ERR!peer @angular/compiler-cli@"^12.0.0 || ^12.1.0-next" from @angular-devkit/[email protected]
npm ERR!node_modules/@angular-devkit/build-angular
npm ERR!dev @angular-devkit/build-angular@"~12.1.1" from the root project
npm ERR!
npm ERR! 無法解決依賴關系。
npm ERR! peer @angular/compiler@"12.2.6" from @angular/[email protected]
npm ERR!node_modules/@angular/localize
npm ERR!peerOptional @angular/localize@"^12.0.0 || ^12.1.0-next" from @angular- devkit/[email protected]
npm ERR!node_modules/@angular-devkit/build-angular
npm ERR!dev @angular-devkit/build-angular@"~12.1.1 "來自根專案
npm ERR!
npm ERR! 修復上游依賴性沖突,或者重試
npm ERR!使用 --force 或 --legacy-peer-deps 命令。
npm ERR! 來接受一個不正確的(可能是壞的)依賴關系決議。
@angular/[email protected]但@angular/[email protected]需要@angular/compiler@"12.2.6"。我猜想你的package.json看起來像:"@angular/compiler":"12.1.5",
"@angular/localize":"12.2.6"。
