我在進行簡單的 npm 安裝時遇到問題。我正在使用 Angular 最新的 cli 版本。我已經重新安裝了 angular、node 和 npm,但似乎并沒有解決這些問題。
這是我的 eresolve 報告:
While resolving: [email protected]
Found: @angular/[email protected]
node_modules/@angular/common
@angular/common@"~11.2.14" from the root project
Could not resolve dependency:
peer @angular/common@"^13.0.0 || ^14.0.0-0" from @angular/[email protected]
node_modules/@angular/cdk
@angular/cdk@"^13.3.7" from the root project
Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.
Raw JSON explanation object:
{
"code": "ERESOLVE",
"current": {
"name": "@angular/common",
"version": "11.2.14",
"whileInstalling": {
"name": "fsl-angular-task",
"version": "0.0.0",
"path": "<cant show directory>"
},
"location": "node_modules/@angular/common",
"isWorkspace": false,
"dependents": [
{
"type": "prod",
"name": "@angular/common",
"spec": "~11.2.14",
"from": {
"location": "<cant show directory>"
}
}
]
},
"currentEdge": {
"type": "prod",
"name": "@angular/common",
"spec": "~11.2.14",
"from": {
"location": "C:\\<cant show directory>"
}
},
"edge": {
"type": "peer",
"name": "@angular/common",
"spec": "^13.0.0 || ^14.0.0-0",
"error": "INVALID",
"from": {
"name": "@angular/cdk",
"version": "13.3.7",
"whileInstalling": {
"name": "fsl-angular-task",
"version": "0.0.0",
"path": "C:\\<cant show directory>"
},
"location": "node_modules/@angular/cdk",
"isWorkspace": false,
"dependents": [
{
"type": "prod",
"name": "@angular/cdk",
"spec": "^13.3.7",
"from": {
"location": "<cant show directory>"
}
}
]
}
},
"strictPeerDeps": false,
"force": false
}
有沒有人可以幫忙,謝謝?????????????????
uj5u.com熱心網友回復:
您使用的是npm哪個版本?node我相信升級到較新的節點版本可能會解決問題。
發生此錯誤是因為您嘗試安裝沖突的軟體包:
@angular/common@"~11.2.14" from the root project
// and
@angular/common@"^13.0.0 || ^14.0.0-0"
嘗試添加--legacy-peer-deps標志,這不是真正推薦的,但可能會忽略您的問題。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/480582.html
下一篇:NPM安裝無CD檔案夾
