Just because i always forget this stuff. If you ever have above error message and you use a proxy with npm to download files. Just make sure that your environment or proxy related settings include “http or https” at the start.
So HTTP_PROXY=http://<yourproxy>:<port> same implies for https_proxy etc etc
If you forget this, build could still run correctly. In my case i had a internal repo for npm (sinopia) so when a package wanted to download something from github it failed because of this.