Maybe just try
npm i --legacy-peer-deps
If that did'nt do it, First run
rm -rf node_modules
This will remove your node modules folder.
Then go through your package.json and install each dependency alone.
If you face an error for a specific library install it without the version tag.