I recently came across an npm error and wanted to share it with you so you will know what to do in case that it happens to you. The issue will only happen if your npm is version 7 or more.
when I tried to do npm install I received this error:
nothing I tried to do to fix this worked until I run the command like this:
npm i --legacy-peer-deps
The reason for this is probably that since NPM v7 now installs peerDependencies by default.
hope this is helpful.