为什么我的yarn用不了了?

yarn create umi 的时候发现yarn总是失败。。

info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.npm.taobao.org/rxjs/download/rxjs-6.5.3.tgz: ESOCKETTIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\damia\\AppData\\Local\\Yarn\\Data\\global\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...

然后用一个别的项目把依赖删了再装试一下,结果还是不行。。

info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.npm.taobao.org/core-js/download/core-js-2.6.10.tgz: ESOCKETTIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "C:\\svnMyProject\\council-admin-vue-new-180127\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

原来的源和淘宝源都不行。
请问这是什么原因?是yarn的问题还是我家网的问题?(顺便我用手机开热点试了一下,也不行)

阅读 4.8k
1 个回答

如果你通过浏览器直接下载https://registry.npm.taobao.org/core-js/download/core-js-2.6.10.tgz没问题,那应该是超时时间太短导致的。

修改超时时间试试:

yarn install --network-timeout 1000000000
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题