Angular CLI: 14.2.3
Node: 16.15.1
Package Manager: npm 8.12.1
OS: darwin x64
我正在安裝角度引導程式(試圖)從 NPM 收到以下錯誤
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: tractapp@0.0.0
npm ERR! Found: @angular/core@14.2.2
npm ERR! node_modules/@angular/core
npm ERR! peer @angular/core@"14.2.2" from @angular/animations@14.2.2
npm ERR! node_modules/@angular/animations
npm ERR! peer @angular/animations@"^14.0.0 || ^15.0.0" from @angular/material@14.2.2
npm ERR! node_modules/@angular/material
npm ERR! @angular/material@"^14.2.2" from the root project
npm ERR! peerOptional @angular/animations@"14.2.2" from @angular/platform-browser@14.2.2
npm ERR! node_modules/@angular/platform-browser
npm ERR! peer @angular/platform-browser@"^12.0.0 || ^13.0.0 || ^14.0.0" from @angular/fire@7.4.1
npm ERR! node_modules/@angular/fire
npm ERR! @angular/fire@"^7.4.1" from the root project
npm ERR! 6 more (@angular/forms, @angular/material, ...)
npm ERR! 2 more (@swimlane/ngx-charts, the root project)
npm ERR! peer @angular/core@"^14.0.0 || ^15.0.0" from @angular/cdk@14.2.2
npm ERR! node_modules/@angular/cdk
npm ERR! peer @angular/cdk@"14.2.2" from @angular/material@14.2.2
npm ERR! node_modules/@angular/material
npm ERR! @angular/material@"^14.2.2" from the root project
npm ERR! peer @angular/cdk@">=12.0.0" from @swimlane/ngx-charts@20.1.0
npm ERR! node_modules/@swimlane/ngx-charts
npm ERR! @swimlane/ngx-charts@"^20.1.0" from the root project
npm ERR! 2 more (ng2-charts, the root project)
npm ERR! 16 more (@angular/common, @angular/compiler, @angular/fire, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! @ng-bootstrap/ng-bootstrap@"13.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/core@14.2.6
npm ERR! node_modules/@angular/core
npm ERR! peer @angular/core@"14.2.6" from @angular/forms@14.2.6
npm ERR! node_modules/@angular/forms
npm ERR! @angular/forms@"^14.2.0" from the root project
npm ERR! peer @angular/forms@"^14.1.0" from @ng-bootstrap/ng-bootstrap@13.0.0
npm ERR! node_modules/@ng-bootstrap/ng-bootstrap
npm ERR! @ng-bootstrap/ng-bootstrap@"13.0.0" 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 錯誤以及這些錯誤的表述方式不是我的強項,如果有人可以幫助我并在這里為我指明正確的方向,我會很高興。
謝謝!
這也是我的 package.json 檔案,我假設它在其中的某些東西是錯誤的形成/陳述方式。
{
"name": "tractapp",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "^14.2.0",
"@angular/cdk": "^14.2.2",
"@angular/common": "^14.2.0",
"@angular/compiler": "^14.2.0",
"@angular/core": "^14.2.0",
"@angular/fire": "^7.4.1",
"@angular/forms": "^14.2.0",
"@angular/material": "^14.2.2",
"@angular/platform-browser": "^14.2.0",
"@angular/platform-browser-dynamic": "^14.2.0",
"@angular/router": "^14.2.0",
"@fortawesome/angular-fontawesome": "^0.11.1",
"@fortawesome/fontawesome-svg-core": "^6.2.0",
"@fortawesome/free-solid-svg-icons": "^6.2.0",
"@stripe/stripe-js": "^1.37.0",
"@sweetalert2/ngx-sweetalert2": "^12.0.1",
"@swimlane/ngx-charts": "^20.1.0",
"aos": "^2.3.4",
"apexcharts": "^3.35.5",
"chart.js": "^3.9.1",
"ng-apexcharts": "^1.7.1",
"ng2-charts": "^4.0.1",
"ngx-print": "^1.2.1",
"ngx-stripe": "^14.1.0",
"rxjs": "~7.5.0",
"stripe": "^10.11.0",
"sweetalert2": "^11.5.1",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^14.2.3",
"@angular/cli": "~14.2.3",
"@angular/compiler-cli": "^14.2.0",
"@types/d3": "^7.4.0",
"@types/jasmine": "~4.0.0",
"jasmine-core": "~4.3.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"typescript": "~4.7.2"
}
}
uj5u.com熱心網友回復:
根據 OP 的要求將評論移至答案,以便可以將問題標記為已解決。
查看Github 發布頁面(于 22 年 10 月 12 日訪問 v 13.0.0),目前對該庫的最大支持是 Angular 14.1,而您使用的是 14.2.2。這似乎是一個版本兼容性問題(本質上該庫正在嘗試提取舊版本的 Angular,而您遇到了沖突)
您要么必須降級 Angular 版本,要么使用其他東西
uj5u.com熱心網友回復:
在你的 vs 代碼終端中安裝 ng bootstrap 之前運行 npm update ,這將修復它
uj5u.com熱心網友回復:
這成功了,感謝 Burhan Hyder
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/514533.html
下一篇:依賴3rd方包
