Skip to content

Commit

Permalink
fix(doc): add a note about troubleshooting network errors (#259)
Browse files Browse the repository at this point in the history
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
SpencerKaiser and aduh95 committed Apr 29, 2023
1 parent f539ae2 commit aa3cbdb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion sources/httpUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`));
});
});
}
Expand Down

0 comments on commit aa3cbdb

Please sign in to comment.