Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create-astro doesn't respect system proxy config or environment variables #5256

Closed
1 task
yonkeltron opened this issue Oct 31, 2022 · 13 comments · Fixed by #5579
Closed
1 task

create-astro doesn't respect system proxy config or environment variables #5256

yonkeltron opened this issue Oct 31, 2022 · 13 comments · Fixed by #5579
Labels
- P2: nice to have Not breaking anything but nice to have (priority) ecosystem: upstream Upstream package has issue

Comments

@yonkeltron
Copy link

What version of astro are you using?

1.6.1

Are you using an SSR adapter? If so, which one?

No

What package manager are you using?

yarn

What operating system are you using?

macOS

Describe the Bug

I am unable to initialize a new project with astro-create due to it not following the system proxy settings or respecting the proxy environment variables I have in place.

The following variables are set:

HTTP_PROXY
HTTPS_PROXY
http_proxy
https_proxy
ALL_PROXY
all_proxy
$ create-astro

╭─────╮  Houston:
│ ◠ ◡ ◠  I'll be your assistant today.
╰─────╯

 astro   v1.6.1 Launch sequence initiated.

? Where would you like to create your new project? › potato
✔ Where would you like to create your new project? … potato
✔ How would you like to setup your new project? › a few best practices (recommended)
          ■■▶ Copying project files...(node:5863) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
          ■■▶ Copying project files...Failed to download https://github.com/withastro/astro/archive/latest.tar.gz: 401 authenticationrequired

Eager to help understand what's wrong, unfortunately I can't create a minimal example due to it being isolated to the corporate network I'm currently on. Sorry!

How else can I test or provide more info?

Link to Minimal Reproducible Example

N/A

Participation

  • I am willing to submit a pull request for this issue.
@bholmesdev
Copy link
Contributor

Thanks for reporting @yonkeltron! Dang, this is indeed a tricky one to replicate. I'll say we use giget under-the-hood to fetch project templates, so that project would likely need tweaks to respect environment variables for network proxies. May be worth:

  • writing a small-scale script that uses giget's JS API to replicate
  • if it still fails, file an issue on their repo with that minimal reproduction

Hope that helps!

@bholmesdev bholmesdev added the - P2: nice to have Not breaking anything but nice to have (priority) label Nov 1, 2022
@natemoo-re
Copy link
Member

natemoo-re commented Nov 10, 2022

There's actually an upstream issue for this feature, as well as a PR!

unjs/giget#23 and unjs/giget#24

@natemoo-re natemoo-re added the ecosystem: upstream Upstream package has issue label Nov 10, 2022
@danielroe
Copy link

This has been merged and released in giget@1.0.0.

@yonkeltron
Copy link
Author

This has been merged and released in giget@1.0.0.

Super exciting! Let me know when I can give create-astro a test run!

@yonkeltron
Copy link
Author

Hey just wanted to let you know that create-astro 1.2.4 still doesn't respect the proxy variables. Did I do something wrong?

@yonkeltron
Copy link
Author

Just a bit more info here:


╭─────╮  Houston:
│ ◠ ◡ ◠  Time to build a sweet new website.
╰─────╯

 astro   v1.9.2 Launch sequence initiated.

✔ Where would you like to create your new project? … panda
✔ How would you like to setup your new project? › a few best practices (recommended)
          ■■▶ Copying project files...Failed to download https://github.com/withastro/astro/archive/latest.tar.gz: 401 authenticationrequired

@yonkeltron
Copy link
Author

FYI I can reproduce this error still in the 2.0 release.

create-astro@2.0.2

astro v2.0.4 Launch sequence initiated.

@yonkeltron
Copy link
Author

Just an update that this still fails with create-astro@3.0.0:

╭─────╮  Houston:
│ ◠ ◡ ◠  Let's claim your corner of the internet.
╰─────╯

 astro   v2.0.9 Launch sequence initiated.

   dir   Where should we create your new project?
         ./panda

  tmpl   How would you like to start your new project?
         Include sample files
Failed to download https://github.com/withastro/astro/archive/latest.tar.gz: 401 authenticationrequired

@calebdwilliams
Copy link
Contributor

I can confirm this issue still exists on the latest version (2.5.7 as of this post). This issue should be re-opened.

@calebdwilliams
Copy link
Contributor

Specifically this is failing with create-astro@3.1.5

@yonkeltron
Copy link
Author

Can confirm this is still an issue with create-astro@3.1.6:

$ create-astro

╭─────╮  Houston:
│ ◠ ◡ ◠  Initiating launch sequence...
╰─────╯

 astro   v2.6.0 Launch sequence initiated.

   dir   Where should we create your new project?
         ./panda

  tmpl   How would you like to start your new project?
         Include sample files
      ▲  error Failed to download https://github.com/withastro/astro/archive/latest.tar.gz: 401 authenticationrequired

@teehemkay
Copy link

I can confirm this is still an issue with create-astsro@4.3.2

npm create astro@latest -- --template starlight


 astro  Launch sequence aborted.

      ▲  error Unable to connect to the internet.

@indefinitelee
Copy link

this is an issue for me with npm create astro@latest I am behind a corporate firewall and using an internal registry which is set in the .npmrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority) ecosystem: upstream Upstream package has issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants