MeshJS / mesh

An open-source library to advance Web3 development on Cardano

Home Page:https://meshjs.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree

besiwims opened this issue · comments

  1. What causese this error or npm dependecy error?
  2. What do you do to solve it?
  3. Why are you getting this error?

wims@wimspc:~/mesh/packages/demo$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: @meshsdk/playground@0.1.0
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR! react@"18.2.0" from @meshsdk/playground@0.1.0
npm ERR! packages/demo
npm ERR! @meshsdk/playground@0.1.0
npm ERR! node_modules/@meshsdk/playground
npm ERR! workspace packages/demo from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.0.0 || ^16.0.0 || ^17.0.0" from react-highlight@0.14.0
npm ERR! node_modules/react-highlight
npm ERR! react-highlight@"^0.14.0" from @meshsdk/playground@0.1.0
npm ERR! packages/demo
npm ERR! @meshsdk/playground@0.1.0
npm ERR! node_modules/@meshsdk/playground
npm ERR! workspace packages/demo 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!
npm ERR! For a full report see:
npm ERR! /home/wims/.npm/_logs/2023-03-27T01_07_07_726Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR! /home/wims/.npm/_logs/2023-03-27T01_07_07_726Z-debug-0.log

Answers:

  1. This is caused by using a reactjs version lower than the reactjs used in the project you have cloned and have executed the command npm install. Actually it is a node version problem. Your node version is lower than that of the latest project being cloned.
  2. There are many ways to solve this: a) upgrade your nodejs if possible. b) if not possible then run npm install --force and know that you might face dependency issues with the project at some point in time unless you are lucky
  3. The reality is that we will never be on the same versions in our different projects and as such one has to do a thorough research of the needs of what you are doing well in advance