Open KevSlashNull opened 3 years ago
Could you test this code which is used by CLI? Does it always return taobao registry?
@fangbinwei, it doesn't always return the taobao registry. Looks like the 15s yesterday were pretty random. :thinking:
I've modified the script to show the time for both requests. It also checks more than one package because I think this might not be a bug inside vue cli.
Using vue-cli-version-marker https://registry.yarnpkg.com: 541.241ms https://registry.npm.taobao.org: 558.983ms Using siegegg-api https://registry.yarnpkg.com: 418.443ms https://registry.npm.taobao.org: 1851.088ms Using express https://registry.yarnpkg.com: 408.303ms https://registry.npm.taobao.org: 1738.040ms Using request https://registry.yarnpkg.com: 406.914ms https://registry.npm.taobao.org: 1123.147ms Using ts-node https://registry.yarnpkg.com: 409.492ms https://registry.npm.taobao.org: 430.789ms Using axios https://registry.yarnpkg.com: 385.833ms https://registry.npm.taobao.org: 1614.157ms Using bootstrap https://registry.yarnpkg.com: 411.516ms https://registry.npm.taobao.org: 1024.958ms Using jquery https://registry.yarnpkg.com: 406.809ms https://registry.npm.taobao.org: 1967.655ms
Using vue-cli-version-marker https://registry.npm.taobao.org: 256.945ms https://registry.yarnpkg.com: 468.953ms Using siegegg-api https://registry.npm.taobao.org: 156.621ms https://registry.yarnpkg.com: 399.340ms Using express https://registry.npm.taobao.org: 227.382ms https://registry.yarnpkg.com: 366.645ms Using request https://registry.npm.taobao.org: 159.970ms https://registry.yarnpkg.com: 357.367ms Using ts-node https://registry.npm.taobao.org: 102.781ms https://registry.yarnpkg.com: 404.320ms Using axios https://registry.npm.taobao.org: 130.075ms https://registry.yarnpkg.com: 406.246ms Using bootstrap https://registry.npm.taobao.org: 307.449ms https://registry.yarnpkg.com: 351.657ms Using jquery https://registry.npm.taobao.org: 215.520ms https://registry.yarnpkg.com: 342.015ms
It appears that Taobao's registry is slower for initial requests but faster for subsequent requests (caching?). So that's why I think it's not a bug in Vue CLI, as the Taobao registry is faster after the first initial much slower request. From my side, I'd close the issue, it's probably just weird behavior by the registries and the Taobao one appears to be actually faster except for the first request which confused me. :sweat_smile:
This feature is friendly to Chinese users, sine taobao registry is always faster than other registries. For other areas with fast internet, it’s hard to say which registry is faster 😢
Yeah, that's great for Chinese users to have a faster option. I'm wondering how reliable it would be to test via ping instead of requests?
PING yarn.npmjs.org (104.16.23.35) 56(84) bytes of data. 64 bytes from 104.16.23.35 (104.16.23.35): icmp_seq=1 ttl=58 time=28.6 ms 64 bytes from 104.16.23.35 (104.16.23.35): icmp_seq=2 ttl=58 time=33.1 ms 64 bytes from 104.16.23.35 (104.16.23.35): icmp_seq=3 ttl=58 time=29.3 ms 64 bytes from 104.16.23.35 (104.16.23.35): icmp_seq=4 ttl=58 time=65.4 ms 64 bytes from 104.16.23.35 (104.16.23.35): icmp_seq=5 ttl=58 time=28.8 ms 64 bytes from 104.16.23.35 (104.16.23.35): icmp_seq=6 ttl=58 time=29.6 ms 64 bytes from 104.16.23.35 (104.16.23.35): icmp_seq=7 ttl=58 time=28.5 ms 64 bytes from 104.16.23.35 (104.16.23.35): icmp_seq=8 ttl=58 time=30.3 ms 64 bytes from 104.16.23.35 (104.16.23.35): icmp_seq=9 ttl=58 time=29.6 ms 64 bytes from 104.16.23.35 (104.16.23.35): icmp_seq=10 ttl=58 time=32.3 ms --- yarn.npmjs.org ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9015ms rtt min/avg/max/mdev = 28.575/33.604/65.499/10.732 ms
PING registry.npm.taobao.org.w.cdngslb.com (47.246.43.230) 56(84) bytes of data. 64 bytes from 47.246.43.230 (47.246.43.230): icmp_seq=1 ttl=55 time=72.7 ms 64 bytes from 47.246.43.230 (47.246.43.230): icmp_seq=2 ttl=55 time=76.1 ms 64 bytes from 47.246.43.230 (47.246.43.230): icmp_seq=3 ttl=55 time=76.5 ms 64 bytes from 47.246.43.230 (47.246.43.230): icmp_seq=4 ttl=55 time=82.2 ms 64 bytes from 47.246.43.230 (47.246.43.230): icmp_seq=5 ttl=55 time=67.0 ms 64 bytes from 47.246.43.230 (47.246.43.230): icmp_seq=6 ttl=55 time=76.0 ms 64 bytes from 47.246.43.230 (47.246.43.230): icmp_seq=7 ttl=55 time=70.8 ms 64 bytes from 47.246.43.230 (47.246.43.230): icmp_seq=8 ttl=55 time=75.7 ms 64 bytes from 47.246.43.230 (47.246.43.230): icmp_seq=9 ttl=55 time=80.6 ms 64 bytes from 47.246.43.230 (47.246.43.230): icmp_seq=10 ttl=55 time=71.2 ms --- registry.npm.taobao.org.w.cdngslb.com ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9013ms rtt min/avg/max/mdev = 67.054/74.936/82.266/4.362 ms
IPv6 is even faster than IPv4 for yarn, so I forced IPv4 so it's the same version.
Hello,
I opted for the switch but I don't know if that is the cause. But when I run vue create
command, it always times out for me. I can't even get started with a project. Below is the screenshot of the timeout.
Can you please tell me how to switch out of taobao registry?
First you can check yarn config get registry
then, you can check useTaobaoRegistry
in the config .vuerc
, maybe is located on C:/User/your_name/
.vuerc
{
"packageManager": "yarn",
"useTaobaoRegistry": false
}
@gopinav
Yeah deleted the .vuerc file from %USERPROFILE% and FINALLY after half a day, I have a project running. I really don't think the suggestion should be made to use taobao registry. Thanks for your help.
See also https://github.com/vuejs/vue-cli/issues/5261 Yeah, the test implementation is not that reliable.
First you can check
yarn config get registry
then, you can check
useTaobaoRegistry
in the config.vuerc
, maybe is located onC:/User/your_name/
.vuerc
{ "packageManager": "yarn", "useTaobaoRegistry": false }
@gopinav
Thanks it helps me ! It was exactly that I was looking for :)
Wow, this surprised me—first time using the vue cli. The solution provided by fangbinwei worked for me. Thank you!
Version
4.5.8
Environment info
Steps to reproduce
I don’t know how to reproduce this exactly, unfortunately.
What is expected?
The CLI only suggests another registry if it’s significantly better than the current registry.
What is actually happening?
The CLI suggests https://registry.npm.taobao.org which has a response time of 15-45-times the current registry’s response time.
Example output of testing the response time with curl. I reproduced this multiple times.