yarnpkg / berry

📦🐈 Active development trunk for Yarn ⚒
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.43k stars 1.11k forks source link

Is there a mirror we chinese could use? #982

Closed taoqf closed 3 years ago

taoqf commented 4 years ago

Describe the user story

The network is blocked in our country, when we run yarn set version berry there will be an net error because the domain https://raw.githubusercontent.com/yarnpkg/berry/master/packages/berry-cli/bin/berry.js is blocked. this is the error

Resolving berry to a url...
Downloading https://github.com/yarnpkg/berry/raw/master/packages/berry-cli/bin/berry.js...
error An unexpected error occurred: "https://github.com/yarnpkg/berry/raw/master/packages/berry-cli/bin/berry.js: connect ECONNREFUSED 151.101.228.133:443".
info If you think this is a bug, please open a bug report with the information provided in "/home/taoqf/myproj/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/policies for documentation about this command.

Describe the solution you'd like

Maybe we can use an mirror options to change the url to https://cdn.jsdelivr.net/gh/yarnpkg/berry/packages/berry-cli/bin/berry.js or other url , or even a local file.

liyachun01 commented 4 years ago

if you are behind a proxy, use it. for instance, in your .bashrc/anyrc file, prepend "export http_proxy=[your proxy]" will do. Or maybe you can try yarn config set proxy/https-proxy before yarn set version berry. You know what a proxy means I assume 🐶

nyaapass commented 4 years ago

it can be solved by setting up a proxy:

https://www.jhipster.tech/configuring-a-corporate-proxy#yarn-configuration

John0King commented 4 years ago

maybe just install it globally with npm install -g yarn ?

arcanis commented 4 years ago

I'm in the process of setting up a light proxy so that future yarn set version calls will hit yarnpkg.com rather than the GitHub servers.

John0King commented 3 years ago

@arcanis I'm still think use npm directly is a much simpler solution. a) have you count the project in github that use yarn2 insteal of yarn 1 ? b) does thoese project want to use yarn2 ? c) does any feature in yarn1 is not supported in yarn2

if the anser is a) most project use yarn1 b) they want to use yarn2 c) no or only a few feature that not very commonly used.

then I want just to install latest yarn by npm insatll -g yarn

and infact , to use locale version of yarn(any npm packge) is possible :

{
 "scripts":{
       "yarn" : "./node_modules/yarn/yarn.cmd || ./node_modules/yarn/yarn.sh",
        "tsc" :"./node_modueles/typescript/tsc.cmd",
       "build": "yarn run yarn  run  tsc" 
        // here we make the latest yarn to detect the `yarn` script , and use that directly without the `yarn run yarn` prefix 
   }

}

or even better, directly detect the yarn package in devDependencies section of package.json

John0King commented 3 years ago

and please at least to make a discussion in your team

arcanis commented 3 years ago

New versions will use the Yarn website as source for the binaries (specifically, repo.yarnpkg.com).

AsceticBoy commented 3 years ago

@arcanis when support it

uwang commented 2 months ago

use yarn@1 for no other way