enter code hereWhen I try to install react-sortable-tree npm package getting error like "unable to resolve dependency tree" and solution for this is given in that error message "Fix the upstream dependency conflict, or retry this command with --force or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution."
What's the right way to go about fixing this upstream dependency conflict? without using --force or --legacy-peer-deps how can I fix it?
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! react@"^18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.3.0" from [email protected]
npm ERR! node_modules/react-sortable-tree
npm ERR! react-sortable-tree@"*" 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! /Users/user/.npm/_logs/2024-04-25T05_31_59_043Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: /Users/user/.npm/_logs/2024-04-25T05_31_59_043Z-debug-0.log
In my package.json I have "react": "^18.2.0".