diff --git a/README.md b/README.md index a68555daf..39d55d2c4 100644 --- a/README.md +++ b/README.md @@ -217,6 +217,16 @@ network interaction. - `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` are supported through [`node-proxy-agent`](https://github.com/TooTallNate/node-proxy-agent). +## Troubleshooting + +### Networking + +There are a wide variety of networking issues that can occur while running `corepack` commands. Things to check: + +- Make sure your network connection is active. +- Make sure the host for your request can be resolved by your DNS; try using `curl [URL]` from your shell. +- Check your proxy settings (see [Environment Variables](#environment-variables)). + ## Contributing See [`CONTRIBUTING.md`](./CONTRIBUTING.md). diff --git a/sources/httpUtils.ts b/sources/httpUtils.ts index e3a745c0f..97fec0d83 100644 --- a/sources/httpUtils.ts +++ b/sources/httpUtils.ts @@ -22,7 +22,7 @@ export async function fetchUrlStream(url: string, options: RequestOptions = {}) }); request.on(`error`, err => { - reject(new Error(`Error when performing the request`)); + reject(new Error(`Error when performing the request to ${url}; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting`)); }); }); }