There are several solutions to this problem. I have come across this many times, and different things have always helped me.
A. First try flushing the cache: flushing the cache npm cache clean --force then npm install
B. Secondly, you can try npm install --update-binary
C. Third option is to try A and delete the node_modules folder and then npm install
D. The fourth option is to remove nodejs, reboot and reinstall, and then try npm install
E. The last of my options that worked for me was to delete the npm and npm-cache folders in Users%username%\AppData\Roaming and run npm install
You can try other combinations, it is usually better to always do A and at least clear the cache or delete the node_modules folder.
source share