I had the same problem when I tried to install the npm package AVA
. The solution for me was to delete the node_modules folder and force-clean the npm cache:
rm -rf node_modules
npm cache clean --force
I could then install the npm package without a problem.