I am getting this error while running sudo npm install. On my server, npm was installed earlier. I\'ve tried to delete the package-lock.json file,
sudo npm install
package-lock.json
I faced this issue. It was my network connectivity. I changed network (from Broadband WiFi to 4G WiFi) and tried. It worked.
My broadband ISP was blocking all http requests. That might be the reason I guess in my case.