I have migrated my Angular version from v12 to v13, in this process i tried deleting the node_modules and again tried installing node_modules but i am not able to do this using straight npm install and I am getting these below errors:
D:\test\Fxt\Web\src\main\ui\material>npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: material@3.0.0
npm ERR! Found: @angular/cdk@13.3.9
npm ERR! node_modules/@angular/cdk
npm ERR! @angular/cdk@"13.3.9" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/cdk@"^11.0.0" from @ncstate/sat-popover@7.1.0
npm ERR! node_modules/@ncstate/sat-popover
npm ERR! @ncstate/sat-popover@"^7.1.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 ERR!
npm ERR! See C:\Users\Machine\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Machine\AppData\Local\npm-cache\_logs\2022-07-27T07_23_05_623Z-debug-0.log
D:\test\Fxt\Web\src\main\ui\material>
The full error report as follows of C:\Users\Machine\AppData\Local\npm-cache\eresolve-report.txt:
# npm resolution error report
2022-07-27T07:23:24.600Z
While resolving: material@3.0.0
Found: @angular/cdk@13.3.9
node_modules/@angular/cdk
@angular/cdk@"13.3.9" from the root project
Could not resolve dependency:
peer @angular/cdk@"^11.0.0" from @ncstate/sat-popover@7.1.0
node_modules/@ncstate/sat-popover
@ncstate/sat-popover@"^7.1.0" 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/cdk",
"version": "13.3.9",
"whileInstalling": {
"name": "material",
"version": "3.0.0",
"path": "D:\\test\\Fxt\\Web\\src\\main\\ui\\material"
},
"location": "node_modules/@angular/cdk",
"isWorkspace": false,
"dependents": [
{
"type": "prod",
"name": "@angular/cdk",
"spec": "13.3.9",
"from": {
"location": "D:\\test\\Fxt\\Web\\src\\main\\ui\\material"
}
}
]
},
"currentEdge": {
"type": "prod",
"name": "@angular/cdk",
"spec": "13.3.9",
"from": {
"location": "D:\\test\\Fxt\\Web\\src\\main\\ui\\material"
}
},
"edge": {
"type": "peer",
"name": "@angular/cdk",
"spec": "^11.0.0",
"error": "INVALID",
"from": {
"name": "@ncstate/sat-popover",
"version": "7.1.0",
"whileInstalling": {
"name": "material",
"version": "3.0.0",
"path": "D:\\test\\Fxt\\Web\\src\\main\\ui\\material"
},
"location": "node_modules/@ncstate/sat-popover",
"isWorkspace": false,
"dependents": [
{
"type": "prod",
"name": "@ncstate/sat-popover",
"spec": "^7.1.0",
"from": {
"location": "D:\\test\\Fxt\\Web\\src\\main\\ui\\material"
}
}
]
}
},
"strictPeerDeps": false,
"force": false
}
Strangely I am able to do npm install with special command by post-fixing --force or --legacy-peer-deps to npm install which is working. Can anyone help me out on this.
Thanks.