I am recently getting this error when attempting to deploy my firebase functions. However, I didn\'t change any dependencies since last successful deploy...
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
/etc/hosts