volta
volta copied to clipboard
Can't install Yarn
$ volta install yarn
error: Could not download Yarn version registry
from https://registry.npmjs.org/yarn
Please verify your internet connection.
volta version: 1.0.8
My global .npmrc:
registry=https://mirrors.cloud.tencent.com/npm/
home=https://mirrors.cloud.tencent.com/npm/
https://registry.npmjs.org/yarn has been blocked by GFW, but why volta use the default registry instead of my config
Hi @wenjoy, great question! We actually don't use npm internally to fetch Yarn, which is why we don't pick up settings in .npmrc. We do support proxy settings via the HTTP_PROXY and HTTPS_PROXY environment variables.
Alternatively, we have a hooks mechanism described here: https://docs.volta.sh/advanced/hooks that allows you to replace the location that Volta uses to fetch Node, npm, and yarn. However, the hooks behavior around Yarn specifically is a bit complicated since it has to support a legacy use-case, so it may take some extra effort to get it to work. I'm happy to help debug if you want to go that route.
Hi @charlespierce, where were find the doc for using proxy variables to install node with volta?
Hi @wenjoy, great question! We actually don't use
npminternally to fetch Yarn, which is why we don't pick up settings in.npmrc. We do support proxy settings via theHTTP_PROXYandHTTPS_PROXYenvironment variables.Alternatively, we have a hooks mechanism described here: https://docs.volta.sh/advanced/hooks that allows you to replace the location that Volta uses to fetch Node, npm, and yarn. However, the hooks behavior around Yarn specifically is a bit complicated since it has to support a legacy use-case, so it may take some extra effort to get it to work. I'm happy to help debug if you want to go that route.
Thanks, @charlespierce, you are very kind 👍🏿. I have resolved this issue with a proxy, so I think I should close this issue.
Hi @charlespierce, where were find the doc for using proxy variables to install node with volta?
I think all we need to do is set HTTP_PROXY and HTTPS_PROXY environment variables. It's the mechanism of OS. I doubt there is a specific doc on Volta's side.