use --legacy-peer-deps with npm install
for instance
npm install --legacy-peer-deps
if installing a particular dependency
npm install library-name --legacy-peer-deps