-
Notifications
You must be signed in to change notification settings - Fork 169
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
fix: download registry #219
Conversation
This PR works for npm and pnpm because the download links for them are start with definitions.npm.ranges['*'].url: Line 22 in f84cfcb
definitions.pnpm.ranges['>=6.0.0'].url: Line 68 in f84cfcb
But it seems not work for yarn. Line 97 in f84cfcb
definitions.yarn.ranges['>=2.0.0'].url: Line 109 in f84cfcb
@arcanis Should we change the yarn download link in |
AFAIK Yarn 2+ versions are no longer published on the npm registry1 (the last 2+ version published was 2.4.3 published in September 2021), using an npm mirror wouldn't work. I'm not sure what would be the best way to make that customizable, adding a Footnotes |
Perhaps we could have a generic |
Perhaps, to ensure the syntax is somewhat familiar, we can make it a JSON object? For example:
Main problem are the newlines which, while they seem to not be an actual problem when use in env variables per se, may cause wonky behaviours on scripts making incorrect assumptions about the result of Alternatively, perhaps we could have some |
Worth noting that JSON does not require using new lines, so if the new lines are a problem, a simple workaround is to not use them.
I don't think it's a good idea, a DNS override is not something that's defined on a project basis, but rather as a system level, so env variable would make the most sense. Or am I missing something? |
@xiaoxiangmoe if you want to make |
Fix download registry.
Enviroment:
Bug description:
In China, access to
https://registry.npmjs.org
,https://registry.yarnpkg.com/
andhttps://repo.yarnpkg.com/
is unstable. We should usehttps://registry.npmmirror.com
instead.We can modify our
/etc/host
file add a line127.0.0.1 registry.npmjs.org
to simulate npm being unreachable.Then run
COREPACK_NPM_REGISTRY="https://registry.npmmirror.com" corepack prepare pnpm@7.17.0 --activate
. It will try to downloadhttps://registry.npmjs.org/pnpm/-/pnpm-7.17.0.tgz
. COREPACK_NPM_REGISTRY is not working.