Im having issues with doing a simple npm install. I am using angular latest cli version. I have re installed angular, node and npm but it does not seem to resolve these issues.
Here is my eresolve-report:
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
}
Is there anyway someone can help please, thanks
CodePudding user response:
Which npm
and node
version are you using? I believe that upgrading to a newer node version might solve the problem.
This error happens because you are trying to install conflicting packages:
@angular/common@"~11.2.14" from the root project
// and
@angular/common@"^13.0.0 || ^14.0.0-0"
Try adding the --legacy-peer-deps
flag, this is not really recommended but might ignore the issue in your case.