跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • 请教一下,为什么我的 yarn 连接不上 https://registry.yarnpkg.com, timeout error
未分類
12 7 月 2020

请教一下,为什么我的 yarn 连接不上 https://registry.yarnpkg.com, timeout error

请教一下,为什么我的 yarn 连接不上 https://registry.yarnpkg.com, timeout error

資深大佬 : yazoox 123

我输入 create-react-app myapp --typescript

然后得到下面的错误提示

google 了一下,什么–timeout=999999,重启机器,设置 npm registry,node 换成 10.0+,检查 ie 设置,也没有设置 proxy,好像都没有用。还是报一样的错误。

请有经验的大神帮忙看一眼。

系统是 windows10

c:users<username>.npmrc 里面,指向国内的地址,应该没有问题吧?

registry=https://registry.npm.taobao.org/

yarn add v1.22.4 [1/4] Resolving packages... [2/4] Fetching packages... 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.yarnpkg.com/babel-jest/-/babel-jest-24.9.0.tgz: connect ETIMEDOUT 104.16.16.35:443". info If you think this is a bug, please open a bug report with the information provided in "C:\src\myapp\yarn-error.log". info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.  Aborting installation.   yarnpkg add --exact react react-dom react-scripts cra-template-typescript --cwd C:srcmyapp has failed.  Deleting generated file... package.json Deleting generated file... yarn.lock Done. 

找到一个 yarn-error.log 文件,主要 信息如下:

 Yarn version:    1.22.4  Node version:    8.10.0  Platform:    win32 x64  Trace:    Error: connect ETIMEDOUT 104.16.16.35:443       at Object._errnoException (util.js:1022:11)       at _exceptionWithHostPort (util.js:1044:20)       at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)  npm manifest:    {     "name": "myapp",     "version": "0.1.0",     "private": true   }  yarn manifest:    No manifest 

大佬有話說 (2)

  • 資深大佬 : Virace

    yarn config set registry https://registry.npm.taobao.org/

  • 主 資深大佬 : yazoox

    @Virace 谢谢! it works. 这么简单就解决了……

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具