글

라벨이 node package management인 게시물 표시

npm ERR! code ERESOLVE unable to resolve dependency tree: 9 Causes and Fixes

이미지
What npm Is Actually Telling You npm ERR! code ERESOLVE unable to resolve dependency tree means npm found a peer dependency conflict it refuses to guess its way out of. Two packages in your tree each demand a version of the same dependency, and those demands do not overlap. It is not a network error, a corrupt cache, or a broken npm install. The tree you asked for is genuinely unsatisfiable as written. The reason this appeared in projects that installed fine for years is that npm 7 started enforcing peer dependencies instead of silently ignoring them. Nothing about your project got worse; the check got stricter. Below are the nine situations that produce it, most common first, with the fix for each and how to confirm it worked. Error npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! While resolving: my-app@1.0.0 npm ERR! Found: react@18.2.0 npm ERR! Could not resolve dependency: npm ERR! peer react@"^17.0.0" from some-package@3.1....