I am recently getting this error when attempting to deploy my firebase functions. However, I didn\'t change any dependencies since last successful deploy...
Firebase status page mentions that there is an NPM registry outage
https://status.firebase.google.com/incident/Functions/18033
There has been an outage https://status.npmjs.org/incidents/v22ffls5cd6h - they recommend changing your DNS as ISP's are caching the wrong details.
Run this line(I know it's ugly, but it works):
dig www.npmjs.com @1.1.1.1 | tac | echo "$(grep -oP 'www\.npmjs\.com(.)+\t\K([\d\.]*)' -m 1) www.npmjs.com"
Copy and paste the output to the end of /etc/hosts
file