keystonejs / create-keystone-app

CLI app that makes it easy to get started with Keystone
https://keystonejs.com/tutorials/getting-started-with-create-keystone-next-app
MIT License
38 stars 10 forks source link

Setup fails behind HTTP proxy #352

Open zicklag opened 1 year ago

zicklag commented 1 year ago

When running this command, the command get's stuck before starting the create wizard:

$ yarn create keystone-app
yarn create v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-keystone-app@7.0.1" with binaries:
      - create-keystone-app

✨ You're about to generate a project using Keystone 6 packages.

I'm using node v16.14.0 and I'm also behind an HTTP proxy that requires authentication and has a custom certificate, which is likely the cause of the issue, but I'm not sure because there are no error details, the CLI just hangs at that point.

flexdinesh commented 1 year ago

Hey @zicklag! If you could provide a set of steps to replicate this we could investigate what's going on. Not really sure how to help with something that's possibly an issue within your network.

zicklag commented 1 year ago

Hi @flexdinesh thanks for the reply.

In my environment ports 80 and 443 are blocked out to the internet, and I'm required to proxy all my traffic through an HTTP proxy ( in my case it's a Squid server ), which most applications allow you to configure by setting the http_proxy and https_proxy environment variables.

I'm assuming that the keystone CLI is trying to access the internet without using the proxy from my environment variables, which means all requests will time out ( or hang indefinitely ).

I've fixed this in a NodeJS app before by using global-agent to configure a proxy-respecting global HTTP agent for Node.

I ended up using a different backend than Keystone, so I don't really need it anymore, and it might not be worth fixing unless somebody else runs into the same issue.

dcousens commented 1 year ago

Thanks for the detailed description @zicklag, this should be enough for us to recreate the issue if it's on our end. It's likely that prisma was attempting to download the rust binaries during the postinstall step and perhaps that wasn't respecting your proxy.