我有一個構建得很好的 Angular 12 應用程式,沒有錯誤或警告。我使用 Github 編譯并上傳到 Azure。
這是我的 package.json
{
"name": "My Application",
"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-slider/ngx-slider": "^2.0.3",
"@angular/animations": "~12.1.1",
"@angular/cdk": "^12.1.1",
"@angular/common": "~12.1.1",
"@angular/compiler": "~12.1.1",
"@angular/core": "~12.1.1",
"@angular/forms": "~12.1.1",
"@angular/material": "^12.1.1",
"@angular/platform-browser": "~12.1.1",
"@angular/platform-browser-dynamic": "~12.1.1",
"@angular/router": "~12.1.1",
"@kolkov/angular-editor": "^1.2.0",
"@ng-bootstrap/ng-bootstrap": "^10.0.0",
"@ng-select/ng-select": "^7.2.0",
"@sweetalert2/ngx-sweetalert2": "^10.0.0",
"@swimlane/ngx-datatable": "^19.0.0",
"@types/chartist": "^0.11.1",
"@types/leaflet": "^1.5.19",
"animate.css": "^4.1.1",
"bootstrap": "^5.0.2",
"chart.js": "^2.9.4",
"chartist": "^0.11.4",
"check-password-strength": "^2.0.7",
"crypto-js": "^4.1.1",
"file-saver": "^2.0.5",
"material-icons": "^1.0.1",
"moment": "^2.29.1",
"ng-recaptcha": "^9.0.0",
"ng2-charts": "^2.4.2",
"ngx-bootstrap": "^7.0.0",
"ngx-color-picker": "^11.0.0",
"ngx-daterangepicker-material": "^5.0.1",
"ngx-mask": "^12.0.0",
"ngx-perfect-scrollbar": "^10.1.1",
"npm-check-updates": "^16.4.1",
"perfect-scrollbar": "^1.5.3",
"primeicons": "^5.0.0",
"primeng": "^13.0.4",
"rxjs": "^6.0.0",
"sweetalert2": "^11.1.7",
"tslib": "^2.2.0",
"typicons.font": "^2.1.2",
"web-animations-js": "^2.3.2",
"zone.js": "^0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.1.1",
"@angular/cli": "~12.1.1",
"@angular/compiler-cli": "~12.1.1",
"@types/ckeditor__ckeditor5-build-classic": "^28.0.0",
"@types/hammerjs": "^2.0.40",
"@types/node": "^12.11.1",
"typescript": "~4.3.2"
}
}
如前所述,我可以構建得很好,但這是我在 Git 上得到的
Running 'npm install --unsafe-perm'...
57
58
npm ERR! code ERESOLVE
59
npm ERR! ERESOLVE could not resolve
60
npm ERR!
61
npm ERR! While resolving: @ng-bootstrap/ng-bootstrap@10.0.0
62
npm ERR! Found: @angular/compiler@12.1.5
63
npm ERR! node_modules/@angular/compiler
64
npm ERR! @angular/compiler@"~12.1.1" from the root project
65
npm ERR! peer @angular/compiler@"12.1.5" from @angular/compiler-cli@12.1.5
66
npm ERR! node_modules/@angular/compiler-cli
67
npm ERR! dev @angular/compiler-cli@"~12.1.1" from the root project
68
npm ERR! peer @angular/compiler-cli@"^12.0.0 || ^12.1.0-next" from @angular-devkit/build-angular@12.1.4
69
npm ERR! node_modules/@angular-devkit/build-angular
70
npm ERR! dev @angular-devkit/build-angular@"~12.1.1" from the root project
71
npm ERR! 1 more (@ngtools/webpack)
72
npm ERR! 1 more (@angular/platform-browser-dynamic)
73
npm ERR!
74
npm ERR! Could not resolve dependency:
75
npm ERR! peer @angular/localize@"^12.0.0" from @ng-bootstrap/ng-bootstrap@10.0.0
76
npm ERR! node_modules/@ng-bootstrap/ng-bootstrap
77
npm ERR! @ng-bootstrap/ng-bootstrap@"^10.0.0" from the root project
78
npm ERR!
79
npm ERR! Conflicting peer dependency: @angular/compiler@12.2.16
80
npm ERR! node_modules/@angular/compiler
81
npm ERR! peer @angular/compiler@"12.2.16" from @angular/localize@12.2.16
82
npm ERR! node_modules/@angular/localize
83
npm ERR! peer @angular/localize@"^12.0.0" from @ng-bootstrap/ng-bootstrap@10.0.0
84
npm ERR! node_modules/@ng-bootstrap/ng-bootstrap
85
npm ERR! @ng-bootstrap/ng-bootstrap@"^10.0.0" from the root project
86
npm ERR!
87
npm ERR! Fix the upstream dependency conflict, or retry
88
npm ERR! this command with --force, or --legacy-peer-deps
89
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
90
npm ERR!
91
我正在運行 Node 16.14.1。
這一切發生的很突然。
我試過多次更新 npm。我卸載并安裝了所有 npm,我洗掉了 package-lock 和 node_modules 并重新安裝了所有東西。沒有任何效果。
謝謝你的幫助。
uj5u.com熱心網友回復:
你有依賴沖突試試這個
npm install --legacy-peer-deps
檢查這個它可以幫助你
這個鏈接
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/537651.html
標籤:有角度的知乎
