-
Notifications
You must be signed in to change notification settings - Fork 75
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
nuxi always using default npm registry #453
Comments
I meet the same trouble, too. And it seems nuxi will not use the proxy set in system env. |
Thanks for reporting, I think we could catch the error here:
If the error is a fetch failed, fallback to call the proxy. Happy to open a PR? |
I think directly using the user-defined proxy would be better if there is proxy env, cause the waiting time is kind of torture, and this is the default action of many tools and software. |
I see, what could be the proxy env variable? |
normally it would be http_proxy, https_proxy, HTTP_PROXY, HTTPS_PROXY |
Happy to open a PR to support |
PR submitted, but it's about registry support. I find adding mirror registry support way more easy than adding proxy support to reach the similar effect, $fetch in nuxt cli seems not supporting proxy. Introducing another fetch lib or agents stuff is kind of overdoing? |
I think we can close this issue as it's about the npm registry, but we should certainly support proxy environment variable if possible 🙏 we can track in #419 |
Environment
Nuxt project info: 9:52:35 PM
Reproduction
Only in the region where users couldn't access https://registry.npmjs.org, like china, you can reproduce it.
Describe the bug
No matter what registry I set, when I run npx nuxi@latest module add XXX, nuxi report errors like this:
I found that this error was lies in
/home/wdy/.npm/_npx/b95349761371180e/node_modules/nuxi/dist/chunks/add2.mjs:26359:15
, which is:I change the URL here to my current NPM registry, and the problem solved.
Additional context
Should the URL for fetch be changed to the current npm registry rather that https://registry.npmmirror.com ?
Logs
No response
The text was updated successfully, but these errors were encountered: